ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

CodeExtinguisher 2.0 Public Beta (RC10)

February 13, 2008 3:25pm

Subscribe [27]
  • #151 / Mar 12, 2008 4:13am

    ocergyNohtna

    36 posts

    so i made the upgrade to 1.6. all looks well. was wondering what the url structure should look like for the pagination of a table that uses the crud controller? the anchors reflect a clean uri whereas by default it has query strings to reference table names, etc… so i continue to get a “Table name missing” error. i’m sure you’re aware of this difference right?

  • #152 / Mar 12, 2008 6:33am

    abmcr

    254 posts

    Please excuse my question: i have try as beginner CodeExtinguisher 2.0 and all examples work fine.
    After, i have try to get an edit to form as

    general_information:
        class: FieldSet
        params:
            form:
                textbox_test:
                    class: TextBox
                checkbox_test:
                    class: CheckBox
                    params:
                        display_name: Hello there
                date_test:
                    class: Date
                password_test:
                    class: Password
                radiogroup_test:
                    class: RadioGroup
                    params:
                        list:
                            1: One
                            2: Two
                            3: Three
                file_test:
                    class: File
                    params:
                        allowed_types: zip
                        upload_path: ./uploads/
                textarea_test:
                    class: TextArea
                    attributes:
                        rows:5
                        cols:50
                time_test:
                    class: Time
                    params:
                        -on_update
    dbdropdown_test:
        class: DbDropDown
        params:
            field:name
            table:related_example
            primary_key:id
    
    image_test:
        class: Image
        params:
            make_thumbnail: true
            height:100
            width:100
            url_path: uploads/
            upload_path: ./uploads/
    related_example:
        class: OneToMany
        params:
            display_field: name
            table_fields: name,description

    for modify the fieldset , but i get a strange error

    Fatal error: Cannot use string offset as an array in C:\WebServer\xampp\htdocs\CodeIgniter_1.6.1\codex\application\libraries\spyc.php(512) : eval()'d code on line 1

    What is this error? And another question….. it is possible to
    1) insert in the display mode (the grid) values of the table wich have passed a function (for example: i want to show in the display view a thumb of an image… but it is need to intercept the value of the field and managng it with a controller)

    2) it is possible to insert in the form, for a field, a custom javascript (example: for managing a Google Map)

    Thank you and excuse me for my poor english

  • #153 / Mar 12, 2008 6:57am

    ocergyNohtna

    36 posts

    so, sorry for getting so post-happy. i’ve gotten 2.0 up and running and was wondering if someone could point me in the direction of how i would go about altering the way the relations work. for instance instead of returning all of the entries in the relational table with a checked box indicating they belong to the current entry being edited, but to only return the entries associated with the current entry, then the add new link could give two options. 1: choose an entry from a specified table (a table that is being referenced via the relational table...*database schema explained below; bold and bold underline used for further clarity) via a dropdown box populated with values from a column in the specified table with an add button to make the currently selected dropdown item associated with the current entry, which would add an entry to the relational table or 2: create a new entry to be inserted into the specified table AND add an entry to the relational table using the new specified table params. i hope that all makes sense. :gulp: here’s a mock up of a db table structure i’m referring to:

    table name: person
    columns: id, name, description

    table name: hobbies
    columns: id, hobby

    table name: peoplesHobbies
    columns: id, person_id, hobby_id

    i could be wrong, as i am in no way a DB design guru, but i feel this is a simple, clean logical structure to use. and i’ve used it for quite a while. if anyone could make some suggestions as to how i might implement something of this nature, perhaps even as a plugin so it may be given back to the community with great ease, your feedback would be greatly appreciated. comments? thoughts anyone?

  • #154 / Mar 12, 2008 7:52am

    Sean Downey

    34 posts

    Hi jTaby

    Good work on this - RC9 looks really good.

    I tried RC9 last night but the forms (Add, Edit etc) still don’t work in IE6 (haven’t tried IE7) - they gave Permission Errors - it worked in Firefox though.
    I don’t have the exact error message now sorry.

  • #155 / Mar 12, 2008 12:52pm

    Majd Taby

    637 posts

    if there were a situation that were to come up where that wasn’t an option, is a solution for the backwards compat in the works?
    was wondering what the url structure should look like for the pagination of a table that uses the crud controller?

    @ocergyNohtna, yes, I am working on resolving that issue, it’ll be solved by the next release ( The final version, if no bugs are found in RC10)
    @ocergyNohtna yes, the CRUD controller generates GET urls, while the regular controllers you create use the regular CI-Style URLs, i’m working on changing them all to GET variables just for conformity. The table name missing error means your URL is mis-formed…are you changing the URL yourself?

    What is this error? And another question….. it is possible to
    1) insert in the display mode (the grid) values of the table wich have passed a function (for example: i want to show in the display view a thumb of an image… but it is need to intercept the value of the field and managng it with a controller)

    2) it is possible to insert in the form, for a field, a custom javascript (example: for managing a Google Map)

    Thank you and excuse me for my poor english

    @abmcr, are you trying to change the label of the checkbox? If so, you want:

    checkbox_test:<br />           class: CheckBox<br />           label: Hello there

    let me know if that solves your issue
    To answer your question:
    1) Yes definately, go into controllers/example.php and under display_fields add the item: image_test
    2) Of course, you would have to write your own plugin, and you load your javascript code right from the plugin. Take a look at the more advanced plugins for examples (I know, the ManyTomany and OneToMany plugins need refactoring..)

    if anyone could make some suggestions as to how i might implement something of this nature

    @ocergyNohtna, that is exactly how the ManyToMany plugin works…take the same schema that you’ve described, but rename peoplesHobbies to person_hobbies. I don’t understand you first paragraph about the UI though, could you expand? (You might want to look at the DbDropDown plugin, which is a dropdown populated from the db, though it doesn’t have the ability to add new items)

    I tried RC9 last night but the forms (Add, Edit etc) still don’t work in IE6 (haven’t tried IE7) - they gave Permission Errors - it worked in Firefox though.

    @vascopj, hmm, i thought I fixed the IE issue, i’ll test it soon

  • #156 / Mar 12, 2008 7:14pm

    ocergyNohtna

    36 posts

    as for the many to many plugin… the schema isn’t a many to many relationship. well, the example i came up with would be, but i didn’t think long enough about what i’m really doing. i’ve got 2 tables. one is categories, and the other is companies. every company can be located in multiple categories, so that’s just a one to many relation. does that explain my situation better? here’s a mockup of what i was talking about for the UI which may better explain it all:

    http://anthonys.endoftheinternet.org/mockup.jpg

    let me know anyone’s thoughts.

  • #157 / Mar 13, 2008 5:29am

    abmcr

    254 posts

    What is this error? And another question….. it is possible to
    1) insert in the display mode (the grid) values of the table wich have passed a function (for example: i want to show in the display view a thumb of an image… but it is need to intercept the value of the field and managng it with a controller)

    2) it is possible to insert in the form, for a field, a custom javascript (example: for managing a Google Map)

    Thank you and excuse me for my poor english

    @abmcr, are you trying to change the label of the checkbox? If so, you want:

    checkbox_test:<br />           class: CheckBox<br />           label: Hello there</code></pre></p> <p>let me know if that solves your issue</p> <p> </p> </blockquote> <p>Thank you JTaby for reply… i have set a yml as</p><pre><code>general_information: class: FieldSet params: form: textbox_test: class: TextBox label: ciao textarea_test: class: TextArea attributes: rows:5 cols:50

    and i get the same error

    Fatal error: Cannot use string offset as an array in C:\WebServer\xampp\htdocs\CodeIgniter_1.6.1\codex\application\libraries\spyc.php(512) : eval()'d code on

    To answer your question:
    1) Yes definately, go into controllers/example.php and under display_fields add the item: image_test

    Ok:but if i want manage the value before to show: for example, i have a field named image_item , and it store the name of a file (for example: image.jpg). In the display mode, i want to show no the name ofthe file but a thumb of it: i need to get the image name of the file and managing it wth the mage library for create an image at run time… It is possible?

    2) Of course, you would have to write your own plugin, and you load your javascript code right from the plugin. Take a look at the more advanced plugins for examples (I know, the ManyTomany and OneToMany plugins need refactoring..)

    Ok

    Thank you

  • #158 / Mar 13, 2008 10:47am

    Majd Taby

    637 posts

    try
    general_information:<br />   class: FieldSet<br />   params:<br />       form:<br />         textbox_test:<br />           class: TextBox<br />           label: ciao<br />         textarea_test:<br />           class: TextArea<br />           attributes:<br />               rows:5<br />               cols:50

    ...I should write a YAML tutorial…but basically, whitespace is _extremely_ important in yaml: don’t use tabs, use spaces.

  • #159 / Mar 13, 2008 7:37pm

    timj

    80 posts

    Nice improvements.  In the relational plugins (OneToMany, ManyToMany) is it possible to include entry field formats other than textboxes (dropdowns, radio buttons, etc)?  I am looking for an example of that.

  • #160 / Mar 13, 2008 7:37pm

    Majd Taby

    637 posts

    Yes, that’s actually a new feature (I think rc8). The way it works is by creating a yaml file of the same name of the table…it automatically recognizes it.

  • #161 / Mar 13, 2008 7:49pm

    timj

    80 posts

    Sorry, still not quite getting that.  I see if I do not list any params in the YAML file the system automatically picks up all the fieldnames from the named table (very cool).  But the entry/update fields are still text fields.  Can you provide an example of what the YAML would look like to generate other kinds of entry fields?

  • #162 / Mar 13, 2008 7:57pm

    Majd Taby

    637 posts

    actually, if you create a file, you have to define all your elements, not just some of them. I am working on a screencast which should clear things up…it should be up soon.

    On a side note..do you guys think a colorpicker plugin would be an unnecessary bundle?

  • #163 / Mar 14, 2008 3:55am

    Jauhari

    26 posts

    Jauhari, have a look at view_models/table.php. This contains how the table is displayed so you can add your custom tags in here.

    So it is possible to do that right?

  • #164 / Mar 14, 2008 3:59am

    Jauhari

    26 posts

    actually, if you create a file, you have to define all your elements, not just some of them. I am working on a screencast which should clear things up…it should be up soon.

    On a side note..do you guys think a colorpicker plugin would be an unnecessary bundle?

    I have a dream If you have another version of date picker. Just like this http://kelvinluck.com/assets/jquery/datePicker/

    Best Regards

    Jauhari

  • #165 / Mar 14, 2008 8:57am

    abmcr

    254 posts

    try
    general_information:<br />   class: FieldSet<br />   params:<br />       form:<br />         textbox_test:<br />           class: TextBox<br />           label: ciao<br />         textarea_test:<br />           class: TextArea<br />           attributes:<br />               rows:5<br />               cols:50

    ...I should write a YAML tutorial…but basically, whitespace is _extremely_ important in yaml: don’t use tabs, use spaces.

    Ok: with the spaces all workfine: not very easy, but work
    Thank you very much

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases