Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

Duplicate multible fields

Mehr
5 Monate 3 Tage her #9891 von L_Cypherus
Duplicate multible fields wurde erstellt von L_Cypherus
Hello,
I have a form where I have to add 84 times 2 fields to add.
Both with different (layout) settings and stuff.

If it possible to create 2 fields and then duplicate it 83 times to make it easier to add everything?

Mehr
5 Monate 2 Tage her #9892 von Administrator IV
Administrator IV antwortete auf Duplicate multible fields
Hello L_Cypherus,

In your case there is only 1 way to copy fields in the desired way with all the respective settings.
This option is unofficial, but works very well.
If you are a little careful and pay attention, there can be no mistakes and it will work right away.

1 - You export a form with the two fields.
2 - You create a copy of the export file.
3 - You open the export file in an editor.
The export file consists of a single line.
4 - You replace {"id" with [New Line]{"id" in the export file.
[New line] = line break in the editor.
5 - You add a new line before the last three characters ]}].

Here is an example of the export file edited in this way from a form with submit button and reset button and 4 fields:

The 4 fields are at the end, each on its own line.
The lines are quite long and I have replaced the back of each line with '...' for readability.
Code:
[{"shape": {"id":47,"asset_id":0,"name":"json-edited-fields","title":"json-edited-fields", ... "fields":[ {"id":100,"fid":47,"asset_id":0,"name":"submit","label":"submit", ... }, {"id":101,"fid":47,"asset_id":0,"name":"reset","label":"reset", ... }, {"id":102,"fid":47,"asset_id":0,"name":"text-1","label":"text-1", ... }, {"id":103,"fid":47,"asset_id":0,"name":"number-1","label":"number-1", ... }, {"id":104,"fid":47,"asset_id":0,"name":"radio-1","label":"radio-1", ... }, {"id":105,"fid":47,"asset_id":0,"name":"field-separator-1","label":"field-separator-1", ... } ]}]

6 - Now you edit the form.
You add new fields by copying the desired field lines.
You customize the field ID so that the IDs are ascending and unique.
Ascending field IDs are not really necessary, but they make it easier to check the uniqueness of the field IDs when editing.
You can customize the field name and field label as desired.

Attention 1:
The field name must be unique.

Attention 2:
The last field line does not have a comma at the end of the line.
All other field lines above have a comma at the end of the line.

Attention 3:
You are not allowed to insert additional characters in the so-called JSON structure in places that are not enclosed by apostrophes.

Here is the edited example from above:
Code:
[{"shape": {"id":47,"asset_id":0,"name":"json-edited-fields","title":"json-edited-fields", ... "fields":[ {"id":100,"fid":47,"asset_id":0,"name":"submit","label":"submit", ... }, {"id":101,"fid":47,"asset_id":0,"name":"reset","label":"reset", ... }, {"id":102,"fid":47,"asset_id":0,"name":"text-1","label":"text-1", ... }, {"id":103,"fid":47,"asset_id":0,"name":"number-1","label":"number-1", ... }, {"id":104,"fid":47,"asset_id":0,"name":"radio-1","label":"radio-1", ... }, {"id":105,"fid":47,"asset_id":0,"name":"field-separator-1","label":"field-separator-1", ... }, {"id":106,"fid":47,"asset_id":0,"name":"text-2","label":"text-2", ... }, {"id":107,"fid":47,"asset_id":0,"name":"number-2","label":"number-2", ... }, {"id":108,"fid":47,"asset_id":0,"name":"radio-2","label":"radio-2", ... }, {"id":109,"fid":47,"asset_id":0,"name":"field-separator-2","label":"field-separator-2", ... } ]}]

7 - You remove all line breaks and save the file.
The export file now consists of a single line again.
8 - You import the edited file using the 'Import form definition' button in the button bar of the form list.

Option:
Basically, you can also change simple field properties and form properties in the file.
Simple field properties here means properties that do not implement any further logic when set in the field configuration interface, such as 'conditional fields'.

I implemented the whole thing successfully and was able to create a new form by importing the edited file.

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Folgende Benutzer bedankten sich: L_Cypherus

Mehr
5 Monate 2 Tage her #9894 von Administrator IV
Administrator IV antwortete auf Duplicate multible fields
Hello L_Cypherus,

You can also simply copy the two fields using the 'Batch' field action.
You always create 2 new fields per copy process.
Or you copy first 2, then 4, then 8, then etc. many fields.
vi-solutions.de/forum-uploads/copy-form-...eld-action-batch.png

With this method, however, you have to adjust the names of the copied fields individually.
However, with a large number of copy repetitions of the two fields, this is still a rather considerable effort.

However, the 'unofficial' method from the previous post is much easier and faster.

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Mehr
4 Monate 2 Wochen her #9921 von L_Cypherus
L_Cypherus antwortete auf Duplicate multible fields
Thanks. This is indeed a much easier method to use.

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum