Front End Formatting

This topic contains 4 reply and 2 voices, and was last updated by VVV 10 years, 11 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
April 11, 2013 at 11:50 pm 2057
VVV Hi Guys. Must say - loving the plug in so far. A few issues though that I could do with some help with. 1. The form that is displayed to the user is great. Well layed out. Gorgeous. The resulting post however is not. It's all just thrown together. No field title 'bold' (for example). I know that there is the option for custom css - Is there any further documentation for this, or examples? Does it just output to the form or the posted item? 2. The links entered in URL fields do not appear as links on the posted 'article'(?) 3. Section breaks are not displaying on the posted article.   Many thanks again for all of your support and the great plugin. Regards Rich
April 12, 2013 at 1:24 am 2059
Tareq Hasan Tareq Hasan

1. Are you talking about showing the inserted post meta? If thats the case, you should probably use shortcodes or modify your themes single.php to show the way you want. Thats would be the best customization.
2. Hmm…yes, it doesn’t. I would repeat again, you might want to customize it.
3. Section breaks is only for formatting the form, it doesn’t display in post content.

The documentation can be found here.

April 12, 2013 at 1:36 am 2064
VVV VVV

1. No problem.

2. Really? I thought this would been a link out of the box as it is a URL? Any hint on how to make this so?

3. This is quite important for my site. Could you provide any workaround to make it display too?

Many thanks again.

 

Regards

Rich

April 12, 2013 at 2:08 am 2067
Tareq Hasan Tareq Hasan

There is a wpuf_show_custom_fields function in wpuf-functions.php, in your case, replace the function with the updated one:
[php]
function wpuf_show_custom_fields( $content ) {
global $post;

$show_custom = wpuf_get_option( ‘cf_show_front’, ‘wpuf_general’ );

if ( $show_custom != ‘on’ ) {
return $content;
}

$form_id = get_post_meta( $post->ID, ‘_wpuf_form_id’, true );

if ( !$form_id ) {
return $content;
}

$html = ‘<ul class="wpuf_customs">’;

$form_vars = get_post_meta( $form_id, ‘wpuf_form’, true );
$meta = array();

if ( $form_vars ) {

foreach ($form_vars as $attr) {

if ( $attr[‘input_type’] == ‘section_break’ ) {
$html .= ‘<li>’;
$html .= ‘<h2>’ . $attr[‘label’] . ‘</h2>’;
$html .= ‘<div class="details">’ . $attr[‘description’] . ‘</div>’;
$html .= ‘</li>’;

} elseif ( isset( $attr[‘is_meta’] ) && $attr[‘is_meta’] == ‘yes’ ) {
$field_value = get_post_meta( $post->ID, $attr[‘name’] );

if ( $attr[‘input_type’] == ‘image_upload’ || $attr[‘input_type’] == ‘file_upload’ ) {
$image_html = ‘<li><label>’ . $attr[‘label’] . ‘:</label> ‘;

if ( $field_value ) {
foreach ($field_value as $attachment_id) {

if ( $attr[‘input_type’] == ‘image_upload’ ) {
$thumb = wp_get_attachment_image( $attachment_id, ‘thumbnail’ );
} else {
$thumb = get_post_field( ‘post_title’, $attachment_id );
}

$full_size = wp_get_attachment_url( $attachment_id );
$image_html .= sprintf( ‘<a href="%s" rel="nofollow">%s</a> ‘, $full_size, $thumb );
}
}

$html .= $image_html . ‘</li>’;
} else {

$value = get_post_meta( $post->ID, $attr[‘name’] );
$html .= sprintf( ‘<li><label>%s</label>: %s</li>’, $attr[‘label’], make_clickable( implode( ‘, ‘, $value ) ) );
}
}
}
}

$html .= ‘</ul>’;

return $content . $html;
}
[/php]

April 12, 2013 at 2:26 am 2068
VVV VVV

Hey.

Thanks for the reply.

I see that fixes both issues like a dream. You will see why this functionality makes SO much sense from a user perspective :http://snipurl.com/26tdyjb

PERFECT!

Thanks again

Rich

Viewing 4 Posts - 1 through 4 (of 4 total)