- This topic has 8 replies, 3 voices, and was last updated 6 years, 3 months ago by
Steve.
-
AuthorPosts
-
-
October 23, 2015 at 10:09 pm #4726
shayneolMemberI have an editor field (I don’t know if this is happening with other fields) for a Custom Post Type. If I try to add an inline style to text within the editor or add a class to text that has styling, I cannot get the styling to output. I’ve tried the following code in a page template .php file and in the wordpress’ default content field and they work fine. However, If I put it in the editor, the styling does not output with the text. I’m using Piklist v.0.9.9.4
Piklist Editor Field Code:
piklist('field', array( 'type' => 'editor' ,'field' => 'wim_text' ,'label' => 'Content' ,'template' => 'field' ,'options' => array( 'wpautop' => true ,'media_buttons' => true ,'shortcode_buttons' => true ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => '' ,'teeny' => false ,'dfw' => false ,'tinymce' => array( 'resize' => true ,'wp_autoresize_on' => true ) ,'quicktags' => true ,'drag_drop_upload' => true ) ));HTML Code That I’m Trying To Style Within The Editor:
<div style="float:left; width:20%; height:500px"> asdfasdf </div> <div style="float:left; width:20%; height:500px"> asdfadf </div> <div style="float:left; width:20%; height:500px"> asdfasdf </div> <div class="clear"></div>Floats aren’t the only thing that don’t work. Pretty much everything except Header tags do not work.
Code Used To Output On Screen:
<?php $wim_dance = get_post_meta($post->ID, 'wim_text', true); echo apply_filters('the_content', $wim_dance); ?>When I inspect the code in Safari, I notice additional characters being added to the code (Please see attached screenshot)
Thanks,
ShayneAttachments:
You must be logged in to view attached files. -
October 24, 2015 at 9:27 am #4729
SteveKeymasterWhat do you see in the Database? If the data is wrong there, this might be three sabe bug as: https://piklist.com/support/topic/single-quote-marks-are-backslashed-0-9-9-4/
-
October 24, 2015 at 5:55 pm #4730
shayneolMemberHello Steve,
It looks like the information in database is incorrect as well, with a slight difference. When inspecting the code from Safari, there are additional double-quotes that are not showing up in the database (though both views are incorrect).
Attachments:
You must be logged in to view attached files. -
October 26, 2015 at 10:09 am #4740
SteveKeymasterThis will be fixed in v0.9.9.5.
-
October 27, 2015 at 5:22 pm #4768
shayneolMemberHey Steve,
Would you be able to give an ETA on when this next version will be released? -
October 27, 2015 at 8:12 pm #4769
SteveKeymasterThis week. Working on a few more things
-
October 30, 2015 at 6:13 pm #4790
shayneolMemberV.0.9.9.5 seems to resolve this issue. Thanks!!
I do have a visual issue now. The description text for my groups now show below the group instead of to the left (below the group label). This is a minor issue, but I still would like to report it.
piklist('field', array( 'type' => 'group' ,'field' => 'message_item' ,'add_more' => true ,'label' => 'Add Message' ,'description' => 'Add messages for this series. You may add as many messages as needed by clicking the blue "+" button. To add a completely new series, click on the "Add New" button at the top of the page.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'title' ,'label' => 'Message Title' ,'template' => 'field' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ,'placeholder' => 'Message Title' ) ) ,array( 'type' => 'datepicker' ,'field' => 'date' ,'label' => 'Date' ,'template' => 'field' ,'options' => array( 'dateFormat' => 'yy/mm/dd' ) ,'attributes' => array( 'size' => 12 ,'class' => 'large-text' ,'placeholder' => 'Date' ) ) ,array( 'type' => 'text' ,'field' => 'speaker' ,'label' => 'Speaker' ,'template' => 'field' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ,'placeholder' => 'Speaker' ) ) ,array( 'type' => 'text' ,'field' => 'video_url' ,'label' => 'Youtube URL' ,'template' => 'field' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ,'placeholder' => 'Youtube URL' ) ) ) )); ?>Attachments:
You must be logged in to view attached files. -
October 30, 2015 at 7:28 pm #4792
KevinKeymaster@shayneol-
We actually moved the description on the default field template to the bottom of the field to be more consistent with the wp-admin style guide. However you can change it if you like by defining your own field template or modifying the one being used, in this case ‘post_meta’
Let us know if you need anything else.
Kevin
add_filter('piklist_field_templates', 'my_field_templates'); function my_field_templates($templates) { $templates['post_meta']['template'] = '[field_wrapper] <div class="%1$s piklist-field-container"> <div class="piklist-field-container-row"> <div class="piklist-label-container"> [field_label] [field_description_wrapper] <p class="piklist-field-description description">[field_description]</p> [/field_description_wrapper] </div> <div class="piklist-field"> [field] </div> </div> </div> [/field_wrapper]'; return $templates; } -
November 2, 2015 at 11:39 am #4826
-
-
AuthorPosts
- The topic ‘Cannot output inline styles within editors’ is closed to new replies.