andy_woz
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: WP-dTree] Word/Text wrapThis may or not work for you but I’ve succeeded with this CSS hack:
#dtreec a.node, #dtreea a.node, #dtreep a.node, #dtreel a.node, #dtreec a.nodeSel, #dtreea a.nodeSel, #dtreep a.nodeSel, #dtreel a.nodeSel { white-space: normal; line-height: VALUE; padding-bottom: VALUE; display:block; margin:-20px 0 0 20px; }You’ll need to adjust the margins of some of the other child nodes but this seems to work pretty well in all the latest browsers. IE6 looks a little funky but it’s still usable. You’ll need to tweak VALUE to your own needs as well as the margins to get the anchor to line up with any graphics. It’s a hack and it works on a case by case basis only. I can’t guarantee anything but it’s a start if you’re looking for a direction to look in.
Forum: Plugins
In reply to: Custom fields with WYSIWYGOk I’ve had some luck with this added to functions.php
/** * Add Tiny MCE editor to textareas used by custom_field_gui */ function change_mode_cf( $init ) { $edmode = 'specific_textareas'; $init['mode'] = $edmode; return $init; } add_filter('tiny_mce_before_init', 'change_mode_cf'); function change_select_cf( $init2 ) { $edselect = 'mceEditor'; $init2['editor_selector'] = $edselect; return $init2; } add_filter('tiny_mce_before_init', 'change_select_cf');If anyone knows how to squeeze both changes to the init array into one filter that would be fantastic.
The bonus here is that the changes are now part of your theme and you don’t have to worry about core files anymore.
Forum: Plugins
In reply to: Custom fields with WYSIWYGFYI as of v 2.7 the $initArray has moved to wp-admin/includes/post.php line 1237. The above modifications for $initArray remain the same.
Obviously the down side to this as always is that we are modifying a core file that will get blitzed with every upgrade so keep the settings handy.
Forum: Plugins
In reply to: Custom fields with WYSIWYGJust a note that as of 2.7 this no longer works. The $initArray in tiny_mce_config.php is no longer used.
A
Forum: Plugins
In reply to: Missing line breaks in custom field (using FreshPost)……. update. If you’re using TinyMCE advanced as your WYSIWYG editor for your custom field, there’s a checkbox to no longer remove p and br tags on save ….. seems to work.
A
Forum: Plugins
In reply to: Missing line breaks in custom field (using FreshPost)On #2, I’d also like to see if someone has an answer to this. I have a custom field that is used to generate sidebar content in WP. When you enter the info for the first time and publish the page, line breaks and paragraph breaks are good. If you make further edits and re-save the line breaks disappear and it all forms one big chunk. I’ve got a tinyMCE editor on my custom field and everything, it’s great. This really does throw a spanner in the works though. How do we replicate the regular post writing field successfully
As far as I know the data from the custom fields is stored in the wp_postmetatda table in the database it has the same type value, ‘longtext’ as does regular post content so that’s not the answer.
There must be something ‘Special’ about regular post content and teh way WP translates it to the DB.
Any answers out there?
Obviously I’d rather not hack any of the core wp files. I don’t want to watch out for them at upgrade time.
A
Forum: Plugins
In reply to: Custom fields with WYSIWYGI guess I should have mentioned that you will need to add the functionality in your templates to pull the content of the custom fields. However that’s more to do with the plug in itself than the thread which is about getting a wysiwyg editor to appear for the custom field. See the rymed code site and plug in instructions for the best way to get your custom field content into your templates.
A
Forum: Plugins
In reply to: Custom fields with WYSIWYGI’m actually surprised that this doesn’t have proper support out of the box in WP yet. The more WP is used as a CMS the more this feature would be worthwhile. There are probably other ways to do this so if you have found one, please share it with us. Not sure if this will help you or not. You will need to do some hand coding.
I have had some success using rc_custom_field gui from rhymed code
With this plug in installed a couple of quick edits are required to a couple of the files.
If you are using pages, edit rc-custom-field-gui.php and add:
add_action( 'edit_page_form', array( 'rc_custom_field_gui', 'insert_gui' ) );after line 42.
In rc-custom-field-gui.class.php find the secton that deals with text areas and add class=”mceEditor” to the textarea generating code around line 138 so that it reads:
$out = '<tr style="padding-bottom:30px;">' . '<th scope="row" valign="top">' . $title . ' </th>' . '<td> <textarea id="' . $name . '" name="' . $name . '" type="textfield" rows="' .$rows. '" cols="' .$cols. '" class="mceEditor">' .attribute_escape($value). '</textarea></td>' . '</tr>' . '<tr><td colspan="2"> </td></tr>'; return $out;With those two things set, go to wp-includes > js > tinymce > tiny_mce_config.php and around line 137 (tinyMce init settings) change the first two init. lines to read:
'mode' => 'specific_textareas', 'editor_selector' => 'mceEditor',Make sure the plugin in activated and empty your cache. Refresh your edit posts/pages.
Remember to re-edit the tinyMce config file if you change any core files when you upgrade to a new version of WP.
Best of luck
A
Forum: Fixing WordPress
In reply to: Sidebar content based on specific pagesThis might help:
http://wordpress.org/extend/ideas/topic.php?id=504&replies=5
Forum: Themes and Templates
In reply to: index.php vs home.php How to access both?Thanks ifelse. I guess it’s the template loader script that’s foxing me rather than the files themselves.
Forum: Themes and Templates
In reply to: index.php vs home.php How to access both?Bump
Forum: Themes and Templates
In reply to: index.php vs home.php How to access both?From the support docs:
“For example, if your blog is at http://example.com/wordpress/ and a visitor loads the page http://example.com/wordpress/, WordPress looks for a template file called home.php and uses it to generate the requested page. If home.php is missing, WordPress looks for a file called index.php in the active theme’s directory, and uses that template to generate the page.”
So Ok thanks for your input, but how do I call one or the other if WP always displays the top template in the heirarchy by default. I’m asking how to access the next template down in the heirarchy when both are present.
Cheers.