0

I'm wondering if there's any way to create a new input format for assigning tags to entries in Channel Form (previously safecracker). I run a directory site and business owners will be editing their own listings and I want them to be able to assign tags to their entries. But they may not be familiar with how tags work, and even if they are they won't know which tags are available for them to use. So I want to list all possible tags in that tag groups in a list on the entry edit page, and allow them to use checkboxes to select tags that apply to their business.

Is there any way I can create my own HTML structure to have each tag as a checkbox item and tags that get checked are assigned to the entry?

Or am I stuck with using the tag widget or a simple textarea where all tags must be written in?

1

If the user isn't going to create tags as part of the process, why use the Solspace Tag module at all... just use EE's native categories which you can manually add in the control panel and they can select via checkboxes.

| improve this answer | |
  • Yes I suppose that's an option I hadn't considered. But if it's possible to use Tag that would still be my preference. – Benek Lisefski Nov 5 '13 at 20:01
  • What is your reason to use the Tag Module? It adds a layer of complexity into your project that you probably don't need based on the brief details you posted in your question. – Anna_MediaGirl Nov 5 '13 at 20:37
  • 1. We already use it elsewhere on the site. 2. I like some of the other features around relationships and ranking. 3. In the future we may want to add in the capability for the user to create or suggest new tags. 4. We are going to have many many groups of tags that will display for selection based on which channel or category the entry is in, I think working with Tag groups will be easier than category groups in this case. But I'm certainly open to other options if they will do a better job. – Benek Lisefski Nov 5 '13 at 20:51
  • 1
    I ended up ditching the Tag module for this purpose and using native categories. Works well enough. – Benek Lisefski Apr 4 '14 at 22:37
1

If you are okay with doing a multi-step submission process, you could try a combination of manipulating the Tag:Form template tag and populating it with the Tag:Cloud template tag.

http://www.solspace.com/docs/tag/form/#examples (last example as your base)

{exp:tag:form
    form_id="my_form"
    return="path_to/my_template"
    entry_id="{entry_id}"
}

   {exp:tag:cloud
      channel="whatever"
      limit="25"
      orderby="tag_name"
      sort="asc"
   }
      <input type="checkbox" name="tags[]" value="{tag}" id="{tag}_label" />
      <label for="{tag}_label">{tag}</label>
   {/exp:tag:cloud}

   <input type="submit" name="submit" value="Submit Tags" />

{/exp:tag:form}

You may have to put the Tag:Cloud tag inside an embed to get it to work, and I'm not 100% certain this solution will work.

| improve this answer | |
  • Thanks for the solution. I'll give it a try once we get to that stage of development. Having to add a second step rather than saving the data as part of the entry creation/edit process might be a dealbreaker, but it's good to know it may be possible if we really want to stick to using Tag for this. – Benek Lisefski Nov 5 '13 at 22:58

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.