i've an issue using Tag with Channel Form in front. I've Tag v.4.2.8 and it's setted in the CP

Tag CP settings

and the code is

{exp:channel:form channel="spots" class="form-horizontal" return="spot/ENTRY_ID/URL_TITLE" }
      <div class="form-group">
        <label class="control-label col-xs-1">Titolo</label>
        <div class="col-xs-11">
          <input class="form-control" placeholder="Inserisci il titolo della tua domanda" name="title" type="text">
        <div class="form-group">
        <div class="form-group">
          <label class="control-label col-xs-1">Tags</label>
          <div class="col-md-11">
            <textarea class="form-control" rows="1" name="tags"></textarea>
            <p class="help-block">Separa ogni tag con la virgola</p>
        <div class="form-group">
          <input type="submit" value="Submit">

But when try to submit tags commas separate

example, taga, commas

the results is only one tag with the commas

<a href="">example, taga, commas</a>

Where i'm wrong?


You could always just use the {field:tag_fieldtype_short_name} tag, which Solspace recommends in their docs. If that doesn't work you can always look at the page source after it parses and see the way Solspace requires the field.

Docs for using the Tag module in channel form.


As mentioned in another answer, you would need to use the Tag Widget, i.e. {field:my_tag_custom_field_name} to add tags from a Channel Form in which you're creating a new channel entry.

What happens in the background is that tags are added to a textarea field with name="my_tag_custom_field_name", with each tag on a separate line (newline-separated). If you have a regular textarea field with your Tag field's name in the name="" attribute, you can also enter new tags as long as each tag is on their own line. This happens to be a coincidence that it works, since Channel Form should use the Tag Widget.

Alternatively, you can use {exp:tag:form} to add tags to a pre-existing entry: http://www.solspace.com/docs/tag/form/. In this case, you would have to create an entry first, then add tags to the newly created entry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.