Git Product home page Git Product logo

table.ee_addon's Introduction

Table

Table FieldType for ExpressionEngine (Beta). Note; this add on is used in production on several websites but I'm not providing support for it (for now). If you need anything you can always ask me on Twitter though.

Example table

Available Cell Types

  • Image
  • Text
  • Title + Image

Note; the Image field will use Assets if it is installed, or the regular ExpressionEngine File filetype if not.

Tags

Field parameters

  • row_limit: Maximum number of rows to return
  • row_offset: Start at row X
  • col_limit: Maximum number of cols to return
  • col_offset: Start at col X

Field tags

{table:rows}

{table:rows} will iterate all rows in the table with

  • {table:row:num}: the current row number
  • {table:row:total_cols}: column count in this row
  • {table:row:type}: the type of this row
  • {table:col}: a loop with all cols in this row

{table:col}

{table:col} will iterate all columns in the current row

  • {table:col:num}: the current column number
  • {table:col:content}: html for the current col
  • {table:col:content_raw}: database content for the current row
  • {table:col:content:num_words}: number of words in row (applies if text)
  • {table:col:content:num_chars}: number of characters in row (applies if text)

Example

Example template for field named "page_table":

{if page_table}
    {page_table}
        <table>
            {table:rows}
            <tr class="row-{table:row:type}">
                {table:col}
                <td class="col{table:col:num}{if table:col:content:num_words > 1} col-left-align{/if}">{table:col:content}</td>
                {/table:col}
            </tr>
            {/table:rows}
        </table>
    {page_table}
{/if}

Database format

The fieldtype stores the data in a format which should be pretty easy to get data from should you need it;

  • Each field will get its own table named "exp_table_yourfieldname"
  • Each row is a row in the database table
  • Each column is a col in the database table

Example table:

+----------------+----------+-----+-------------+-------------------+-------------------+--------------------------------------+-------+-------+
| table_table_id | entry_id | row | row_type    | col_1             | col_2             | col_3                                | col_4 | col_5 |
+----------------+----------+-----+-------------+-------------------+-------------------+--------------------------------------+-------+-------+
|              4 |       32 |   2 | title_image | {"title_text":""} | {"title_text":""} | {"assets_file_id":2,"title_text":""} | NULL  | NULL  |
|              3 |       32 |   1 | text        | This              | Hello             | is                                   | NULL  | NULL  |
+----------------+----------+-----+-------------+-------------------+-------------------+--------------------------------------+-------+-------+

Changelog

table.ee_addon's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.