Ionize User Guide Version 0.9.6


Article views

One article is linked to one or more pages.

Articles are displayed in the context of a page.

Creating an article view and link it to an article

  1. Use a text editor and save the file with the name you wish in the /themes/your_theme/views/your_article_view.php,
  2. Activate the view as an "article" view : see Activate pages and articles views,
  3. Edit the page containing the article to link to this view,
  4. In the article list, select the view in the view dropdown

Iterating through articles in the view

They are 2 ways of iterating through articles :

  1. Using the <ion:article /> tag and display each article with its linked view,
  2. Looping into article's data directly in the page view.

Case 1 : Using of the article tag

Let's say we have 2 articles.

Each article is linked to a view, the first one to the view my_first_article.php and the second one to the view my_second_article.php.

When iterating through articles, the first article will be displayed with the view my_first_article.php.

my_first_article.php will contains articles tags such as title, content, etc.

<!-- Display, for each article, the view linked to the article through Ionize -->
<ion:articles >

   <ion:article />

<ion:articles >

Case 2 : Looping into articles data

In this case, the linked view of the article isn't used.

<!-- Displays directly data from articles -->
<ion:articles >

   <ion:title />

   <ion:content />
 
<ion:articles >