Skip Navigation

[Resolved] Adding Term Fields for hierarchically taxonomy with CRED

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 9 replies, has 2 voices.

Last updated by Beda 6 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#523528
tax.png

I am trying to add an "Add"- / "Edit"-button to add / edit a new term to a hierarchically tax. By using [cred_field field='tax-kontakt-zustaendigkeit_add_new' taxonomy='tax-kontakt-zustaendigkeit' type='add_new'] an "Add New"-button will be rendered. But there is no input field to enter a tax term.

Is it possible to add new terms / edit existing termsfor hierarichal taxinomies?

#523689

You can easyly add new Terms of a Taxonomy, also when it's a hierarchical Taxonomy.

Simply autogenerate the CRED Form and the Taxonomy Interface will present all necessary elements.
This are the 2 fields you need:
[cred_field field='taxonomy-slug' display='checkbox']
[cred_field field='taxonomy-slug_add_new' taxonomy='taxonomy-slug' type='add_new']

I am also attaching a screenshot of how this looks on the front end if added with the autogenerate button.

I am a little confused about your Ticket Title.
You mention "Adding Term Fields for hierarchically taxonomy with CRED", but then in the issue description you never mention Term Fields, so I assume it's all about the Terms themselves.

But to be sure, let me also describe here how it works for Taxonomy Term Fields (Custom Fields).

You cannot add, edit or see Term Fields on a CRED Form.
Term Fields are to be used only in Views listing Taxonomies or their Archives, and can be added or edited only in the Backend.

I will query with our Developers what it would take to add them to the CRED Forms as well.

#523763
without-cond-output.png
with-cond-output.png

Dear Beda!
Thank you for your quick reply! Your support is really bloody amazing 🙂

Sorry for confusing you. Maybe my english is not so good than I thougt 😉

I think I found the problem. Here is my code:

[credform class='cred-form cred-keep-original']

	[cred_field field='form_messages' value='']
<div class="cred-group cred-group-Beitragsfelder-Kontakte">  
  <div class="cred-field cred-field-kontakt-typ">
    <label class="cred-label"> Typ </label>
    [cred_field field='kontakt-typ' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  
  
  <div class="cred-group cred-group-taxonomies">
  <strong>[cred_show_group if="($(kontakt-typ) eq  '1' )"  mode='fade-slide']</strong>
    <div class="cred-taxonomy cred-taxonomy-tax-kontakt-zustaendigkeit">
    <div class="cred-header">
      <h3>Zuständigkeiten</h3>
    </div>
    [cred_field field='tax-kontakt-zustaendigkeit' display='checkbox']
    <div class="cred-taxonomy-auxilliary cred-taxonomy-auxilliary-tax-kontakt-zustaendigkeit_add_new"> [cred_field field='tax-kontakt-zustaendigkeit_add_new' taxonomy='tax-kontakt-zustaendigkeit' type='add_new'] </div>
  </div>
  <strong>[/cred_show_group]
    [cred_show_group if="($(kontakt-typ) eq  '2' )"  mode='fade-slide']</strong>
    <div class="cred-taxonomy cred-taxonomy-tax-kontakt-einsatzgebiet">
    <div class="cred-header">
      <h3>Einsatzgebiete</h3>
    </div>
    [cred_field field='tax-kontakt-einsatzgebiet' display='checkbox']
    <div class="cred-taxonomy-auxilliary cred-taxonomy-auxilliary-tax-kontakt-einsatzgebiet_add_new"> [cred_field field='tax-kontakt-einsatzgebiet_add_new' taxonomy='tax-kontakt-einsatzgebiet' type='add_new'] </div>
  </div>
     <strong>[/cred_show_group]</strong>
</div>
  <div class="cred-field cred-field-kontakt-vorname">
    <label class="cred-label"> Vorname </label>
    [cred_field field='kontakt-vorname' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  <div class="cred-field cred-field-kontakt-nachname">
    <label class="cred-label"> Nachname </label>
    [cred_field field='kontakt-nachname' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  <div class="cred-field cred-field-kontakt-spitzname">
    <label class="cred-label"> Spitzname </label>
    [cred_field field='kontakt-spitzname' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  <div class="cred-field cred-field-kontakt-e-mail">
    <label class="cred-label"> E-Mail </label>
    [cred_field field='kontakt-e-mail' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  <div class="cred-field cred-field-kontakt-telefon">
    <label class="cred-label"> Telefon </label>
    [cred_field field='kontakt-telefon' post='beitragstyp-kontakt' value='' urlparam=''] </div>
  <div class="cred-field cred-field-kontakt-anmerkungen">
    <label class="cred-label"> Anmerkungen </label>
    [cred_field field='kontakt-anmerkungen' post='beitragstyp-kontakt' value='' urlparam=''] </div>
</div>
[cred_field field='form_submit' value='Einsenden' urlparam='']
[/credform] 

I tried to use a conditional ouput. This works only for the taxonomy list but not for the add function. (See screenshot)

Is there a solution?

Greetings
Frank

#523895

1. This makes no sense:

<strong>[cred_show_group if="($(kontakt-typ) eq  '1' )"  mode='fade-slide']</strong>

Why would you put a conditional in a strong statement?
This will not do anything.
You can remove the "strong".
So the code looks alike:

[cred_show_group if="($(kontakt-typ) eq  '1' )"  mode='fade-slide']

2. To hide the whole Taxonomy GUI from the form, you should follow this:
- generate the form with the "autogenerate" button
- find the Taxonomy section (it begins with <div class="cred-group cred-group-taxonomies">)
- locate the single DIV for your specific Taxonomy (in my case it's <div class="cred-taxonomy cred-taxonomy-category">)
- wrap that entire DIV in a CRED Conditional as this below example:

[credform class='cred-form cred-keep-original']
  [cred_field field='form_messages' value='']

    <div class="cred-field cred-field-post_title">
      <label class="cred-label">
        Post Name
      </label>
      [cred_field field='post_title' post='post' value='' urlparam='']
    </div>

    <div class="cred-group cred-group-taxonomies">
		
      [cred_show_group if="($(post_title) eq  'title' )"  mode='fade-slide']
        <div class="cred-taxonomy cred-taxonomy-category">
          <div class="cred-header">
            <h3>Categories</h3>
          </div>
          [cred_field field='category' display='checkbox']
          <div class="cred-taxonomy-auxilliary cred-taxonomy-auxilliary-category_add_new">
            [cred_field field='category_add_new' taxonomy='category' type='add_new']
          </div>
        </div>
      [/cred_show_group]		

    </div>

  [cred_field field='form_submit' value='Submit' urlparam='']

[/credform]

That works just fine.

BTW, I think you are german.
I speak fluently german, if you wish to proceed in your native language, please do not hesitate.

#524139

Dear Beda,
ok. Then I switch to German.
Sorry. Ich habe vergessen, die strong-Tags aus dem Quellcode zu nehmen. Die habe ich natürlich nicht in meinem Original-Code verwendet.
Ich habe sciherheitshalber noch einmal Deine Anweisung (und verschiedene Varianten) befolgt. Aber nach wie vor ohne Erfolg.

Hier mein Code:

<div class="cred-group cred-group-taxonomies"> 
	[cred_show_group if="($(kontakt-typ) eq  '1' )"]
  		<div class="cred-taxonomy cred-taxonomy-tax-kontakt-zustaendigkeit">
    		<div class="cred-header"><h3>Zuständigkeiten</h3></div>
    		[cred_field field='tax-kontakt-zustaendigkeit' display='checkbox']
    		<div class="cred-taxonomy-auxilliary cred-taxonomy-auxilliary-tax-kontakt-zustaendigkeit_add_new"> [cred_field field='tax-kontakt-zustaendigkeit_add_new' taxonomy='tax-kontakt-zustaendigkeit' type='add_new']</div>
  		</div>
  	[/cred_show_group]	
  	[cred_show_group if="($(kontakt-typ) eq  '2' )"]
  		<div class="cred-taxonomy cred-taxonomy-tax-kontakt-einsatzgebiet">
    		<div class="cred-header"><h3>Einsatzgebiete</h3></div>
    		[cred_field field='tax-kontakt-einsatzgebiet' display='checkbox']
    		<div class="cred-taxonomy-auxilliary cred-taxonomy-auxilliary-tax-kontakt-einsatzgebiet_add_new"> [cred_field field='tax-kontakt-einsatzgebiet_add_new' taxonomy='tax-kontakt-einsatzgebiet' type='add_new']</div>
  		</div>
  	[/cred_show_group] 
</div>

Wie ich bereits geschrieben habe, funktioniert der Code für die Checkboxen. Diese werden ein bzw. ausgeblendet. Aber das Formular für das Hinzufügen der Taxonomien wird nicht dargestellt.

WICHTIG: Ich benutze Hierarchische Taxonomien.
Zu beachten: Wenn ich meine Taxonomie als Flat abspeichere, ist das Verhalten ein Anderes. Dann wird das Formular dargestellt, aber nicht mehr die Checkboxen.

#524147

Jetzt hab ich es.
Du hast natürlich recht, da scheint ein problem vorzuliegen.

Ich werde dies sobald als mäglich den Entwickern weiterleiten damit diese ein fix bereitstellen können.

Ich werde mich als bald als möglich wieder melden.

#524152

Super! Danke für Deine Hilfe!

#527081

Hallo Beda,
gibt es schon etwas Neues vom Entwickler-Team?

Viele Grüße
Frank

#529129

This is scheduled to be fixed in 2.0, for which i can not state any ETA yet.

I will update you.

#542450

This is resolved in the Current CRED release.

Please update the Plugin, and let me know in a new ticket if there are other issues.

Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.