I have created this custom shortcode in my functions.php :-
add_shortcode('format_plato', 'format_plato_shortcode');
function format_plato_shortcode($atts, $content = '') {
$content = wpv_do_shortcode($content);
$content = sprintf("%200s", $content);
return $content;
}
And I use it in Views when displaying a string field:
[format_plato][types field="plato"][/types][/format_plato]
I was expecting that the string displayed is right justified with up to 200 characters.
e.g. if [types field="plato"][/types] = "ABCD" I would expect the following to be output:
" ABCD" (*)
(*) white space preceeding ABCD are meant to be 196 white spaces.
Instead I get:
"ABCD"
i.e. preceding white spaces are IGNORED on the VIEWS output.
Can you assist with this one?
Thanks a lot.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Alvaro,
I dont think this is a case where views is ignoring the white space. If you try this on a regular page is the result still the same ?
I'm not exactly sure what %200s means. Is there some document on this ?
Please let me know.
Thanks,
Shane
Hi,
It was a php issue - nothing to do with Toolset, please discard this ticket.
Thanks