fixthetree
Forum Replies Created
-
I figured it out.
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?Did you ever clean up the plugin? The development version has a few bugs. It doesn’t correctly limit the “active node” of the tree on any of the widgets except for pages. I’ve tested it with both categories and taxonomy. I did not test links, but I know the other two do not work.
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?Another idea I had for this project would be to have the ability to designate a top-level parent for a given set of nodes.
So for instance if you had the tree below
- Gaming - Doom - Levels - 1 - Quake - Levels - 1 - Unreal
Once you selected “Doom” you’d get the following:
- Levels - 1
Instead, by being able to designate a top level parent, or having the tree keep the top level parent you’d end up with.
- Doom - Levels - 1
This would also address the issue of having no nav bar on pages with no children. It would just show the page you were on with no nodes below.
- Gaming - Unreal
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?I see what you’re talking about. I would add a dropdown selection for the default parent to show when there are no child nodes for a given page/cat/tax. That should take care of the blank nav menu. Beyond that there are other wordpress plugins users could employ to remove the widget entirely from pages they did not want it on.
I would also redesign options that limited the plugin such as the “only direct children” and “show no children” options. Instead, I’d make those fields where IDs could be entered. This would make the plugin more dynamic by being able to control it on multiple pages rather than a site-wide static option.
This is a great plugin, and you’ve done some wonderful work to it. I see no reason for it not to continue to evolve and become more awesome. It has so many uses!
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?I’ll take a look at it and get back to you.
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?Sure. Glad to help out.
I’m sure the code can be improved. I improvised it, but it works well so far. I haven’t found any issues regarding tree function being adversely affected. It might be nice to also have a field where specific ids can be entered for this functionality in case you don’t need it on every page.
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?Here’s the code that adds a check-box to the widget config and allows the current page to be shown as the parent node. I double-checked this against a new install so there shouldn’t be any errors. If you have questions feel free to contact me at drodgersmobile -at- gmail dot com.
// wp-dtree-widget.php (INSERT BEFORE LINE 42)
$settings['activepage_parent'] = isset($new_settings['activepage_parent'])? 1 : 0; // [email protected] (active page as parent)
// wp-dtree-widget.php (INSERT BEFORE LINE 94)
// Add checkbox below highlight/opento checkboxes// wp-dtree-pge-widget.php (INSERT BEFORE LINE 54)
// Add checkbox near child/direct parent dropdown menus<!-- // Checkbox that makes active page the parent node of the tree --> <input class="checkbox" type="checkbox" <?php checked($settings['activepage_parent'], true); ?> id="<?php echo $this->get_field_id('activepage_parent'); ?>" name="<?php echo $this->get_field_name('activepage_parent'); ?>" /> <label for="<?php echo $this->get_field_id('activepage_parent'); ?>" title="Active page becomes the parent node of the tree."><?php _e('Active Page As Parent', 'wpdtree'); ?></label> </p><p> <!-- -->
// wp-dtree.php (INSERT BEFORE LINE 259)
if($args['activepage_parent'] != 0) { $args['child_of'] = get_the_ID(); $nodelist = wpdt_get_pages_nodelist($args); $tree = wpdt_build_tree($nodelist, $args); }
Forum: Plugins
In reply to: [WP-dTree] [Plugin: WP-dTree] Open only node being browsed?Here’s a quick fix to allow this functionality. I’ll update this when I get around to adding a new checkbox option to the widget config.
In wp-dtree-pge.php on line 6. Change
'child_of' => $child_of,
to
child_of' => get_the_ID(),