Members Login



Chronoforms Book

The ChronoForms Book, written for ChronoForms v3 contains 350 pages of invaluable ChronoForms How-tos hints and tips.

Note: many of the ideas can be used in ChronoForms v4 but the admin interface is very differetn and code examples may need to be modified.

ChronoConnectivity Tutorial 1

Here I'm going to show how I could create our simple faqs page, to get started you should have some DB table loaded with data, here is my old FAQs component table structure :

 

 

After installing the Chrono Connectivity component successfully (like any other joomla component) , we navigate through the top admin menu to Components > ChronoConnectivity > Connections Management

 

Click New

we start adding our data as following :

  • First we must add a connection name, Unique one : FAQs_Demo
  • then we choose our data table, here its jos_easyfaq
  • are we going to list all the table rows or some of them ? I'm going to show them all so I will leave this empty, if you need to add some criteria then add your own WHERE SQL statement, maybe you can try something like WHERE id='1', I will get back to this part in a more advanced tutoria, this is the first tutorial :)
  • Header: here we should add the HTML or text for our page header or title, I add some dummy text like: This is our FAQs Page Demo!!!!!!!!
  • Body: this is the first tricky area, the code added here will be displayed the same number of the rows of the table, for example, we have 50 rows at our table, so this Body code will be displayed 50 times, also you can use { + field_name + } to show the field data of this field name at the current row, so I will add this code :
    <hr>
    <p>
    <strong>{name}</strong><br>
    {introtext}
    <br>
    <maintext>
    <br>
    {useful} users found this helpful and {useless} didn't like it much!
    </p>
    <hr>


    pay attention that all text inside the curly brackets are fields names at our FAQs table!
  • Footer: similar to the header, the footer is going to be displayed at the bottom of the page, here I will add {pagination} which will be replaced by next> previous> and pages counter!
  • Body Loop: at this example, it doesnt matter what is the value of this field, however for best performance it can be set to "outside loop", this field determines where the body code will be evaluated for PHP code included, so if you have a PHP code snippet which you want to run and have a different value every loop iteration then you should set this to "inside loop.
  • POST Variables and GET Variables: here you can add any post/get variable names you expect to come to the frontend page of the connection and then you can use them in the WHERE statement inside curly brackets {}, this is better because when you add them here and use them inside brackets, ChronoConnectivity will save them to user session variable so data doesnt get lost on any page navigation/submit!
  • Enable Mambots: do you want to parse content mambots on the code ?
  • all what we explained above was general or frontend view related, now to the backend admin view, at the Admin config tab there are few fields:
  • Data View Fields Names:add here the tables fields names which you want to get shown on the records list view, I will choose id, name, hit
    Please note that if you added a field name which doesn't exist then this may show some errors!
  • Data View Columns titles: add here the column titles for the records list page, of course this should be the same number as the number of fields you just added to the field above, I added : ID, Name, Hits
  • Record Edit Template: this is the code which will get displayed when you open some record for editing/full page view, if you don't care about this function then leave it empty, however, for me I need to add/edit existing records, so first I decided which fields I need to add/edit at reocrds then I created a simple HTML code which has fields names SIMILAR to table fields, this is the code below, see that I have WYSIWYG editors too and PHP to get the Categoris list from another table, you can do more if you are PHP talented:

    <?php
    $editor    =& JFactory::getEditor();
    ?>
    <table>
        <tr>
            <td>Name:</td><td><input type="text" name="name" size="100" value=""></td>
        </tr>
        <tr>
            <td>IntroText:</td><td><?php echo $editor->display( 'introtext',  '' , '100%', '350', '75', '20', false ) ; ?></td>
        </tr>
        <tr>
            <td>MainText:</td><td><?php echo $editor->display( 'maintext',  '' , '100%', '350', '75', '20', false ) ; ?></td>
        </tr>
        <tr>
            <td>hits:</td><td><input type="text" name="hits" value=""></td>
        </tr>
        <tr>
            <td>published:</td><td>
            <select name="published">
            <option value="0">No</option>
            <option value="1">Yes</option>
            </select>
            </td>
        </tr>
        <tr>
            <td>Category:</td><td>
            <select name="cid">
            <?php
                $database->setQuery( "SELECT * FROM #__easyfaq_categories" );
                $categories = $database->loadObjectList();
                foreach($categories as $category){
            ?>
                <option value="<?php echo $category->id; ?>"><?php echo $category->title; ?></option>
            <?php } ?>
            </select>
            </td>
        </tr>
    </table>
    <input type="hidden" name="id" value="">


Now Save the connection, you are done! :)

The results :

Backend record listing page :

 

Backend single record edit page:

 


 

 

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com