Upgrade from 0.9.x to 0.9.9

InstallationTop of Page

We consider you're doing these steps first locally, to be sure everything works fine before uploading your new version on your server.

From the existing 0.9.x :

  1. Get and temporary store the encryption key from /application/config.php : $config['encryption_key']
  2. Save the existing database
  3. Get your theme folder

In the folder containing Ionize 0.9.9 :

  1. Edit /application/config.php and paste your encryption key
  2. Copy your theme folder into /themes/
  3. Launch the installer

After installation :

  1. Delete all the /files/thumb_x folders : The new media tag doesn't need them
  2. In Ionize, set the theme to your theme in Settings > Theme > Options
  3. Adapt your views

Development tipsTop of Page

Page views vs. articles views

In older version of Ionize, articles have views and render itself : the <ion:article /> tag was using the view as defined in the Ionize backend in Page Edition > Options > Articles list and Article views.

We strongly recommend to not use articles views anymore.
Use only page views.

The reasons are not technical :

  • Based on experience, building a website with page and articles views make edition more complicated for users,
  • Also, the developer who maintains the website has to manage a lot of articles views
  • In the fact, often articles views aren't necessary.

Page views : Articles list & Single article view

Pages have 2 kind of views, which can be defined in Options > Attributes > View and Options > Attributes > Single Article View :

If only the View if defined, the frontend will use this view in any situation.

If both View and Single Article View are set, the frontend will :

  • display the view defined in View when the URL asks for a page
  • display the view defined in Single Article View when the URL asks for one article

This behaviour makes the development of pages like blogs very easy.

TagsTop of Page

They are some changes concerning tags.
These changes were necessary to make the tags more logical and more simple to use.

<ion:language />

Before :

<ion:languages>
<ion:url />
</ion:languages>

Now:

<ion:languages>
<ion:language:url />
</ion:languages>

<ion:navigation />

If you don't want to use one helper, simply remove the "helper" attribute.

Before :

<ion:navigation level="0" helper="false">

Now :

<ion:navigation level="0">

<ion:articles />

This tag should be used inside one parent <ion:page /> tag, which tells the <ion:articles /> from which page it has to get the articles.

To loop in a collection of elements, the use of the plural (collection) and the singular tag is mandatory. That means all tags which loops through a collection of elements have single elemnt tag which gives access to the element data.

Before :

<ion:articles>
<ion:title tag="h3" />
</ion:articles>

Now :

<ion:page>
<ion:articles>
<ion:article:title tag="h3" />
</ion:articles>
</ion:page>
To get the articles from a given page.

Before :

<ion:articles from="footer">
<ion:title />
</ion:articles>

Now :

<ion:page:articles id="footer">
<ion:article:title />
</ion:page:articles>

<ion:article />

The use of the <ion:article /> tag to render one article view is not recommended anymore.

In other words, prefer the use of page views only in Ionize, instead of use page AND article views.

Before :

<ion:articles>
<!-- Render of the article by using the "article view" defined in Ionize -->
<ion:article />
</ion:articles>

Now :

<ion:page>
<ion:articles>
<ion:article>
<ion:title tag="h3">
<ion:content />
</ion:article>
</ion:articles>
<ion:page>

<!-- This can also be written like this : -->
<ion:page:articles>
<ion:article>
<ion:title tag="h3">
<ion:content />
</ion:article>
</ion:page:articles>

<!-- All current page articles titles : -->
<ion:page:articles:article:title tag="h3" />

If you need for to render each article with its own view :
- Set the article view in Ionize
- use <ion:article render="true" /> inside the <ion:articles /> tag.

<ion:medias />

The single tag <ion:media /> must be used when looping through media.

For picture, there is no need to define thumbs sizes in Ionize. Telling the tag the wished size will create the resized picture.

Before :

<ion:medias type="picture" limit="1">
<img src="<ion:src folder='310' />" />
</ion:medias>

Now :

<ion:medias type="picture" limit="1">
<img src="<ion:media:src size='310' />" />
</ion:medias>

<!-- Resize method : 'adaptive', 'square', 'border', 'width', 'height'
<ion:medias type="picture" limit="1">
<img src="<ion:media:src size='200,80' method='adaptive' />" />
</ion:medias>

<ion:translation />

This tag never exists anymore. It is replaced by <ion:lang />

Before :

<ion:translation term="you_are_here" />

Now :

<ion:lang key="you_are_here" />

<ion:categories />

Categories list :

Before :

<ion:categories>
<a href="<ion:url />"><ion:title /></a>
</ion:categories>

Now :

<ion:categories>
<a href="<ion:category:url />"><ion:category:title /></a>
</ion:categories

In articles, to display categories to wish this article is linked to :

Before :

<ion:categories separator=", " />

Now :

<ion:article:categories:list link="true" separator=" &bull; "/>

<ion:element />

Before :

<ion:elements type="my_element">
...
</ion:elements>

Now :

<ion:element:my_element>
...
</ion:element:my_element>

See Tag Reference > Content Element for more details

Conditions in viewsTop of Page

Before 0.9.9, creating conditions in views was mostly done with pure PHP.

Now, 2 tags are available for conditions : <ion:my_tag is="value" /> and <ion:my_tag expression="my_expression" />

The tags are detailled in Tag Reference > Shared attributes.

Before :

<?php
$class= '';
if (<ion:index/>%3 == 0) $class = ' last';
if (<ion:index/>%3 == 1) $class = ' first';
?>

<div class="<?php echo($class) ;?>">

Now :

<div class="<ion:index is='1'>alpha</ion:index> <ion:index expression='%4==0'>omega</ion:index>">

Before :

<?php if ('<ion:title />' !='') :?>
 
    <h2><ion:title /></h2>
    <ion:content />

<?php endif ;?>

Now :

<ion:title expression="!=''">

<h2><ion:title /></h2>
    <ion:content />

</ion:title>

Theme filesTop of Page

Static translation files

Rename the files your_theme_lang.php (folder /themes/your_theme/language/xx/) to "theme_lang.php".