GithubHelp home page GithubHelp logo

Comments (6)

brockpetrie avatar brockpetrie commented on July 21, 2024

Thanks Andrew, nice catch. I accidentally deleted a line while doing some code clean-up, so you can solve this problem quite easily by changing lines 276-277 in field.dynamictextgroup.php to the following:

if ($req && $data[$field->handle][$i] == '') {
    $emptyReq = true;
} else if ($data[$field->handle][$i] != '') {   
    $empty = false;
    $emptyRow = false;
}

That should fix it. Let me know if you find any other bugs and I'll get those fixed for the next commit as well. Thanks again, man!

from dynamictextgroup.

andrewminton avatar andrewminton commented on July 21, 2024

Cool,

One thing I noticed when creating an event using this extension is that the samplefield name is retained in the sample code.. i.e I forgot to name my second field to [correct].. so went and re edited the section and named it to "correct" but in the event samplecode it still says

<label>Answers
<input name="fields[answers][samplefield][]" type="text" />
</label>

Is this the desired behaviour or is it not saving fieldname alterations back to the DB?

from dynamictextgroup.

brockpetrie avatar brockpetrie commented on July 21, 2024

First let me preface this by saying that I didn't update the sample code generator, so it's not generating the correct markup to begin with. This will be fixed in the next commitโ€” thanks for pointing it out.

But to the gist of your question: the documentation (which the includes the sample code) for an event is generated when that event is first created, and is saved in the event's file in your /workspace/events directory. To my knowledge, there is no way to easily modify the contents of that file after it's been created (otherwise it'd overwrite any customizations that you made to that file). So even after I get the sample code generation working, the sample code will not be updated when you rename your subfields (or make any Dynamic Text Group modifications for that matter); you'll have to delete and recreate the event to have the documentation reflect the subfield changes.

So you'll just have to remember that the sample code won't be accurate after making any changes to the field. I should also note that the documentation doesn't have any bearing on the functionality of the event/extension; as long as your front-end form fields match the back-end form fields you'll be fine. If you add a subfield with the extension, you'll have to add a field to the front-end.

I'll probably have to add some sort of note to the generated sample code that warns people about that.

from dynamictextgroup.

andrewminton avatar andrewminton commented on July 21, 2024

Hi Brock, gotcha. Didn't know that was the case, so thanks for clearing what happens. The event was created after I had already amended the Section to include the [Correct] naming for my field. So I guess updating the sample code generation on commit will reflect when Event is first created...

Loving what this offers users as far as functionality goes.. Checkboxes and Radio buttons, WOULD be ace.. so much potential for Quiz/Questionaires in my eyes :)

from dynamictextgroup.

brockpetrie avatar brockpetrie commented on July 21, 2024

Working on checks and radios now; they'll be in the next commit! :)

from dynamictextgroup.

andrewminton avatar andrewminton commented on July 21, 2024

Oooh exciting, Virtual high five coming your way! this is gonna be ace. I gotta feeling the Symphony community will send more high fives your way :) laters.

from dynamictextgroup.

Related Issues (15)

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.