Blog

Snippet: adding a Show All option to a page select dropdown April 13, 2009

Someone asked how to add a Show All option to the page select dropdowns generated by VaeML. Personally, I would place Show All as a link next to the dropdown, but if you really wanted to do it, here's how I'd go about it:

Page: 
<v:select id="pageselector" onchange="if (this.value == 'all') { window.location.href='/my_show_all_url'; return false;}">
<option value="all">Show All</option>
</v:select>

Support for Haml and Sass! April 09, 2009

Haml and SASS are meta-langauges that compile into HTML and CSS, respectively. They let you write code that is leaner, more readable, and more easily changed.

We use Haml and SASS for every website we make (even this one!), and will probably never go back.

However, Haml and SASS are typically pretty tough to use for websites that are static or hosted on a server that you don't fully control. This is because they are written in Ruby and designed to be used with Ruby on Rails.

But we've done all the plumbing to make Haml and SASS work automatically on Vae. All you need to do is upload a .haml or .sass file and hit it in your browser. We will automatically compile it to HTML or CSS and cache the compiled version.

I think we are the first shared webhost to do something like this.

Check out how cool Haml is. This code:

#shows
.show
%a{ :href => "/show" } See the show

Becomes this ...

<div id="shows">
<div class="show">
<a href="/show">See the show</a>
</div>
</div>

Haml cuts out all of the extra typing and brainpower associated with closing tags and angle brackets everywhere. It also uses CSS-style identifiers for id and class. For more details, read the documentation.

SASS applies the same principle to stylesheets. This:

#main
:width 97%
p, div
:font-size 2em
a
:font-weight bold
pre
:font-size 3em

Becomes this:

#main {
width: 97%; }
#main p, #main div {
font-size: 2em; }
#main p a, #main div a {
font-weight: bold; }
#main pre {
font-size: 3em; }

Curly brackets are gone, and nesting style rules is now a matter of just using indentation! For more details, read the SASS documentation.

Of course, you can fully use VaeML tags inside Haml. They work just like HTML tags.

Create MySQL Databases directly from Vae March 28, 2009

A lot of people install 3rd party apps (such as Wordpress) that require a MySQL database. You can now generate a MySQL database directly from Vae. Simply go to the Settings tab and select the MySQL subtab.

Databases are created instantly and ready for use with just one click.

Automatic PDF generation from HTML March 19, 2009

In response to feature requests, we have built in support for generating PDFs directly from HTML (and you can use PHP or VaeML code too!).

Rather than fiddling with complicated software packages or PHP libraries, just design your PDF documents the same way you would design a webpage: with HTML and CSS. Almost all HTML and CSS is supported (the main exception being nested tables).

We use the dompdf library to handle PDF generation. Any file ending in .pdf.html will automatically be run through the PDF engine. Any file ending in .pdf.haml will be run through Haml and the PDF engine. Files ending in .pdf.php, or .pdf.haml.php will also be run through PHP.

Retain customers on your store with Amazon Universal Wishlist March 12, 2009

If you're selling products online (through Vae Store or otherwise), you should consider implementing wishlist functionality. It brings back customers that want something but aren't buying it now. If you don't want to implement this yourself, Amazon has launched a service called Universal Wishlist that gives you this functionality by just inserting a script into your page.

To learn more, go here: http://www.amazon.com/wishlist/vendor-button/

New title="" option in <v:template> March 01, 2009

We've finally solved the problem of updating <title> tags on pages that use templates. Simply put a title= attribute in your <v:template> tag and the contents of that attribute will be set in the parameter $title. You can then print it back out in your template file by using <v:text param="title" />.

For more information, check out http://docs.vaeplatform.com/v_template.

Add a search box to your site -- cool! February 26, 2009

Take a look at Sikbox. You can use it to instantly add a searchbox to your site. Really cool.

New Feature: Build Entry title from Multiple Fields February 15, 2009

Scenario: On your website, you have products that each have fields for Name and Color, in addition to price and some other fields. You want to create an Association (Multi) on another section of your site (say, the blog) that allows you to tag Products that are relevant to that particular post.

The Problem used to be: Only one field could be set as title, so it was impossible to see whether you were tagging the Red Doll or the Blue Doll.

Solution: Titles of collection entries can now be built from multiple fields. Simply select all the fields you'd like, and the full title will be built automatically for you. This will affect autogenerated Permalinks as well.

Let us know if you have any questions!