My First DW Anything Studio Document

Дата добавления:
01.01.2017
Последнее изменение:
07.01.2017
Хиты:
2356
Рейтинг:
 
Голосовать:
Хорошо - Плохо

Ответ

The following section describes how to develop the document displaying the standard Joomla! article text along with its title.

Prerequisites

Make sure you have at least one article created in your Joomla! Content Manager.

Defining a Dataset

First of all we should specify how to retrieve data from database. DW Anything Studio dataset will do the job.

  1. Go to the Datasets list and click New to create a dataset.

  2. Enter the following dataset parameters.

    Table B.1. Dataset parameters

    ParameterValueDescription
    Dataset name tutorial_1_data
  3. Click Save and Close.

  4. DW Anything Studio takes you to the Add Dataset Query form to define an SQL query to fetch data from database.

  5. Enter the following query parameters

    Table B.2. Query parameters

    ParameterValueDescription
    Parent query root This is a top-level query
    Query name article The article data will be stored as the article variable. Remember the query name must be alphanumeric
    Query source SELECT title, introtext FROM #__content LIMIT 1 We want to get title and intro text for a single article from database
    Single row yes The single row of data will be stored as a variable
  6. Click Save & Close.

Defining a Template

  1. Go to the Templates list and click New to create a template.

  2. Enter the following template parameters.

    Table B.3. Template parameters

    ParameterValueDescription
    Template name tutorial_1_article
    Source code
    <h1>{$data.article.title}</h1>
    {$data.article.introtext}
    Our template must contain the HTML markup to display an article title and Smarty variables where we want our data to appear
  3. Click Save & Close.

Defining a Document

  1. Go to the Documents list and click New to create a document.

  2. Enter the following document parameters.

    Table B.4. Document parameters

    ParameterValueDescription
    Document name tutorial_1
    Template tutorial_1_article Assigning a previously defined template to a document
    Dataset tutorial_1_data Assigning a previously defined dataset to a document
  3. Click Save & Close.

Setting up the Menu Item

In order to access our document form front end, we need a menu item. Let's create it, following the standard Joomla! procedure.

  1. Click the Main MenuAdd New Menu Item in the Menus menu of your site's administrator panel. (Note that, depending on your site configuration, there can be no Main Menu item in your Menus menu. If so, select the appropriate menu available from front end.)

  2. Type Tutorial 1 Document in the Menu Title text box.

  3. Under the Menu Item Type, click Select.

  4. Select DWAnything — DWAnything Document.

  5. Select tutorial_1 in the Document drop-down list box.

  6. Click Save & Close.

Now you can view your resulting document. Go to front end and click the Tutorial 1 Document menu item.

See also

Категория

Добавить комментарий


Защитный код
Обновить

SEO by Artio