Hello,
Assuming I call this view by in a php taxonomy template called "section".
taxonomy-section.php : 89
<?php print( do_shortcode('[wpv-post-body view_template="presentation-contenu-section"]') ); ?>
This taxonomy have a custom field which is a RTE field called "wpcf-s-content".
I have a shortcode "has_content" simply returning true or false if $content exists.
function func_has_content($atts, $content='') {
// provide defaults
$atts = shortcode_atts(
array(
),
$atts
);
$return = false;
$content = wpv_do_shortcode($content);
if ( strip_tags($content) != '' ) $return = true;
return $return;
}
add_shortcode( 'has_content', 'func_has_content' );
I'm trying this :
[wpv-taxonomy-field name="wpcf-s-content"]
[types termmeta="s-content" output="raw"][/types]
both returning the content
[has_content][wpv-taxonomy-field name="wpcf-s-content"][/has_content]
returning 1
[wpv-conditional if="( '[has_content][wpv-taxonomy-field name='wpcf-s-content' term_id='[wpv-taxonomy-archive info='id']'][/has_content]' eq '1' )" debug="true"]A[/wpv-conditional]
returning nothing
[wpv-conditional if="( '[wpv-taxonomy-field name="wpcf-s-content"]' eq '1' )" debug="true"]B[/wpv-conditional]
returning nothing
[wpv-conditional if="( '[types termmeta="s-content" output="raw"][/types]' eq '1' )"debug="true"]C[/wpv-conditional]
returning nothing
If I use multiple time [has_content] + inside a conditional, then it fails to close the shortcode :
".... [/has_content] "
Thanks a lot,
Best regards,
Wilhem
Ok, i had to move on, so I managed it by php.
But I still think there is an issue with wpv-conditional.
In RTE wpcf-s-content I could have some <span style="color: #...."></span> inside.
If you'd like to set this up in a test environment and give me login and FTP access, I'll be glad to take a closer look. Private fields are active here. If you don't have access to a public test environment let me know and I can set up a sandbox site for you to use.
Hello Christian,
I'll be happy to give you an FTP access ; but as I said I choose to make it work via PHP.
The issue should be located here :
.... <span style="color: #....">< ....
Inside the RTE content, the double quote failed.
Best regards,
Wilhem
I understand, and I'd like to have FTP access so I can activate PHP error logging to debug the code line-by-line if necessary, and I'd like to have wp-admin access to be able to easily test different values in the WYSIWYG field.