Skip Navigation

[Closed] Allow multiple-instances of this field

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Europe/Sofia (GMT+03:00)

This topic contains 8 replies, has 2 voices.

Last updated by George Botsev 9 years, 4 months ago.

Assisted by: George Botsev.

Author
Posts
#264545

I am trying to:

When a custom field is set to"Allow multiple-instances of this field" i would like to be able to have each instance of that field on a new line... for instance i am trying to have the output be an unordered list. However, it defaults to outputting each value inline with the last.

What is the best way to achieve each value on a new line?

Thanks in advance!

#264558

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

It depends on how you are outputting the fields.
If you are doing this via PHP you can use a code like this:

<ul>
<?php
$tests = get_post_meta('wpcf-FIELDNAME');
foreach ((array)$tests as $test) {
  echo '<li>' . $test . '</li>';
}
?>
</ul>

Other way is to use </br> instead of unordered list.

If you are using Views you can use wpv-for-each - https://toolset.com/documentation/views-shortcodes/#wpv-for-each

#266540

Hi when I use:

<ol>[wpv-for-each field="learner]<li>[wpv-post-field name="learner]</li>[/wpv-for-each]</ol>

The output is simply :

[types field="learner??][/types]

I am using Types and Views.

#266587

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

I am not sure how you are getting this.
Can you provide the real code that you are using?

Do you use this code in a view?

Can you test with the field with prefix "wpcf-"?

#266643

Yes i am using this code in a view, here is the view content template (I use tables for drafting layouts, please do not be offended)

[wpv-post-body view_template="None"]
[types field="add-image-video" link="true" id=""][/types]
<h4>The Routine</h4>
<table width="98%" border="0" cellspacing="5" cellpadding="5">
  <tr>
    <td>I will (the Learner)</td>
    <td>Support me by (What the partner needs to do)</td>
  </tr>
  <tr>
    <td><ul>[types field="learner" id=""][/types]
</ul></td>
<td><ol>[wpv-for-each field="support-me-by-what-the-partner-needs-to-do"]<li>[types field="support-me-by-what-the-partner-needs-to-do??][/types]</li>[/wpv-for-each]</ol></td>
  </tr>
</table>

<h4>Environment</h4></br>
<Strong>Things I need Setup:</strong>
<p>[types field="things-i-need-setup" id=""][/types]</p>

<strong>The space needs to be:</strong>
<p>[types field="the-space-needs-to-be" id=""][/types]</p>

</br>

<h4>Time</h4></br>
<strong> <I am happy to do this for:</strong> 
<p>[types field="i-am-happy-to-do-this-for" id=""][/types]</p> 
</br>
<h4>Alternative</h4></br>
<p>[types field="i-could-also-do-this" id=""][/types]</p>

<h4>Skills I am working with</h4>
<p>[types field="skills-i-am-working-with" id=""][/types]</p>

<div class="site-info">
<?php previous_post_link('&laquo; %link', 'Previous post in category: %title', TRUE); ?>
<?php next_post_link('%link &raquo;', 'Next post in category: %title', TRUE); ?>

All of the fields execute apart from the one discussed. I can test with the field prefix.

I really do appreciate the support you are giving me with this.

#266684

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

You have the problem with the field "learner", as far as I can see you have this code:

    <td><ul>[types field="learner" id=""][/types]

and it should be like this:

<ul>[wpv-for-each field="learner"]
<li>[types field="learner" id=""][/types]</li>
[/wpv-for-each]</ol>
#266691
Screen Shot 2014-12-01 at 13.09.51.png

Attached is a screenshot from the rendered wordpress page, i have updated the post and the content table.. this is the error i have been getting.

(Apologies)

#266694

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

#266911

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Okay. I respect your privacy. I am enabling the private field again, and when you are ready, please submit the access credentials there, so I could debug this further.

The topic ‘[Closed] Allow multiple-instances of this field’ is closed to new replies.