• Resolved cleverframes

    (@cleverframes)


    Hi and thank you for your work, ACF Extended is GREAT, I really love it!
    Now a question that it is for sure simple, but I am not very experienced and I am stuck.
    I need to create in the frontend a CPT using a form, and name it according to the values in two fields.
    The post name must be a simple chaining, such as Name + Surname (that is exactly the case).
    I see the option in the form to use custom tags, su I guess I can use something like {field:name} {field:name} and I need to have the space between the two (hope this is possible).
    I tried but it doesn’t work, I mean, I am 100% doing something wrong.
    For sure I don’t get how to use it: what is “field” and what is “name”?
    I see in my fields report: name (and I guess this is one, no rocket science here), key and type, but no “field” so I am not sure:
    1 – if I can combine 2 fields
    2 – how to use tags to call the correct values (label, name, key or something else.
    I apologize if the question is stupid but as I said, I am inexperienced.
    May you give me a clue?
    Thank you in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello @cleverframes,

    Thanks for the feedback! Yeah, I know, I need to write tutorials and documentation to explain further more Dynamic Forms, but for the moment I’m heavily focused on feature implementations.

    I try to keep the UI as clean and self-explanatory as possible, but I can understand that sometimes it isn’t very clear, especially for advanced modules like Dynamic Forms.

    It looks like you struggle with template tags usage, so here are some explanations ??

    The fields label / name / key is a concept you should understand before going deeper into ACF. Here is how to it works. Every field you create, has the following basic informations:

    – Label: This is the field “title” which is printed on the admin/front screen above the input. Ie: “My Field Label”

    – Name: This is a readable “slug” of the “title”. You can customize it during field creation, it is used for internal/advanced purpose (not displayed to user) and is often displayed as: my_field_name (lowercase, underscores instead of spaces).

    – Key: This is a unique identifier of your field. It is automatically created by ACF for internal/advanced purpose (not customizable). It is displayed as: field_abcdef123456

    Here is a screenshot of a field with those 3 settings: https://i.imgur.com/i28ukKi.png

    Note that you can only customize “Label” & “Name”, and not “Key”. Most of the time, when you’ll work with fields, you will rely on “Name”, because they are more readable than “Keys”. Simple PHP usage example: the_field('my_field_name');

    In ACF Extended: Dynamic Forms, you will display those fields inside a form to your visitors. In order to interact with user input in those fields, you can use the following template tags: {field:my_field_name} and {field:field_abcdef123456} in your actions.

    As I said earlier, you should rely on my_field_name (field name), because it is more readable than keys.

    In your case, inside your “Create Post” Action, you can use this tags to print the user input. Example, inside Post Title set the value: {field:first_name} {field:last_name}.

    Here is a screenshot of a form configuration that should look like yours: https://i.imgur.com/sOOycFQ.jpg

    Note that at the bottom of your Dynamic Form, you’ll find a summary of all the fields you can use as template tags, with Label / Names / Keys columns. In this example:

    First Name | first_name | field_abcdef123456
    Last Name | last_name | field_abcdef123456

    Hope you understand it better now ??

    PS: It is possible to redirect the user to the newly created post after the submission. If that’s something you want to do, just let me know, I’ll write a little tutorial for you.

    Regards.

    Thread Starter cleverframes

    (@cleverframes)

    You won the internet today man, thank you very much!
    I got it more complex than needed, now it is very clear and simple.
    I am not redirecting after the form submission, cause the user could need to add multiple posts in a sequence.
    I will add a link to the newly created post in my page.
    Rather if you don’t mind, I was wondering if there is a simple way to call a form from inside another form, it would be ideal in a modal.
    This would be very useful if I am compiling a form to create a CPT, that in its properties has a relationship with another CPT that is not created yet.
    If I can open another creation form, for the other CPT, before completing the first form, it would be by far easier.
    Is this possible?
    Kindest regards

    • This reply was modified 4 years, 9 months ago by cleverframes.
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Well, with Dynamic Forms you can create one form with 2 field groups which create 2 different posts, in one single submission.

    You could setup 2 actions, one for each post creation. Isn’t it what you’re looking for?

    If you want to include an another form in a modal, you will have to create the modal yourself (ACF Extended do not touch front-end that much), and then use shortcode/php code inside that modal.

    Regards.

    Thread Starter cleverframes

    (@cleverframes)

    Ok, I got how to do it. Thank you very much!!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    You’re welcome!

    If you enjoy this plugin, feel free to submit a review, it always helps and it’s much appreciated ??

    Have a nice day!

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Just to let you know that the latest 0.8.5 added new template tags for Dynamic Forms we were discussing in this topic.

    Have a nice day ??

    Regards.

    Thread Starter cleverframes

    (@cleverframes)

    Super! Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Combining form fields to create post name’ is closed to new replies.