Posts Tagged ‘shrewdBar’

WordPress Database Extension

February 9th, 2010 by Keith from shrewdies | No Comments | Filed in Function
Extending the WordPress database is the first step in developing my menu bar.

In most WordPress extensions, a lot of data is hidden in the code.

The massive advantage of Pods is that we can easily store additional data, and manage it very efficiently.

In the first installment of this series, I introduced shrewdBar, explaining it was based on a WordPress plugin that creates a menu by outputting data in the form of a CSS LIst driven menu. This type of menu is quite common – you style a nested list to have hidden items that reveal themselves when the mouse hovers over them. The added attraction of this type of menu is that without the styling, you simply have a nested list of items that search engines can follow.

The CSS issues are for another time. What I need you to realize is that these menus are usually built in code, with a lot of hard-coded links. True, the original menubar, DashBar, on which shrewdBar is roughly based, does have some items that are extracted from WordPress database tables. In my first version of the menu bar, I extended this to extract messages and topics from the Simple:Press forum.

Pods allowed me to put all the menu items into WordPress database tables, and I explain in this article, how I achieved this.

shrewdBar Database

In its current release, I have limited the menu to two tiers, so we have a Pod for the top tier, that you see across the top of the page. Optionally, each of these top level records can have a variable number of child items.

The schematic is:

shrewdies_bar    link    shrewdies_bar_item
name (txt) name (txt)
slug (slug) slug (slug)
bartext (txt) itemtext (txt)
bartitle (txt) itemtitle (txt)
barurl (txt) itemurl (txt)
baritems (pick shrewdies_bar_item)  ¹——∞ itembar (pick shrewdies_bar)
bardisplay (code)
barhold (bool)

Pods automatically creates the name and slug fields when we create a new pod. name identifies the record, and I also use it as a sort order. slug is very useful in many Pods packages, and I’ll cover it in depth later, but it is not really required in the current version of shrewdBar.

The text, title and url fields are the menu links that are used to navigate to different pages. The pick fields are used to relate tables – in this case a one to many relationship.

The top level menu records have two additional fields. The boolean hold field allows menu items to be temporarily hidden, without deleting the record. This is not required for second level items, as it is a simple click to break or make the relationship to a top level menu. The display field allows us to enter PHP code which can programatically control the display giving us very powerful dynamic menus. I’ll be discussing this at length in the next installment.

shrewdBar Options

Like most plugins, shrewdBar needs options to control colors and positioning. Unlike most WordPress plugins, these options no longer have to live in the options table where they soon get lost. I put the shrewdBar options in its own table, which makes it very easy to manage. The options data could be managed using the standard Pods edit page, however I find it better to write a special page with information and instructions. I’ll be covering this in detail in a later installment.

In the next installment, I will explain how simple Pods procedures act on the data to produce the list output that forms the shrewdBar menu.

Tags: , , ,

WordPress Plugin That Isn’t

February 2nd, 2010 by Keith from shrewdies | No Comments | Filed in Function
This is about the WordPress plugin that isn’t a plugin!

It might become one. It started life as one.

But, for now, it is a Pods package, and this is the first part in a series that explains what a Pods package is, how it improves WordPress functionality, and how you can apply it to your own site.

Before we start, I was reminded earlier about the crucial importance of purpose as your first step. When you set out to add functionality to WordPress, you must be clear about why you are doing it. If you employ assistants, or ask for help on the forums here, or elsewhere, you must communicate that purpose clearly.

Xarzu told me earlier that she wanted to write WordPress plugins and asked if I could recommend a comprehensive list of hooks, actions and filters. I subsequently found she’d asked this in just about every forum on the Internet, irrespective of it’s subject matter. That kind of spam is best ignored, but it does serve as a prime example of what goes wrong when you do not have a clear purpose.

Firstly, I noticed that Xarzu had received lots of positive help, despite the poor question. People want to help, but if the goals are not clear, if the question is too vague, if there is lack of purpose, then that help is often wasted. So before you even think of adding any functionality to WordPress, think long and hard about the purpose of your plugin, and who the typical user is.

My latest project started when I tried the Splix theme, and found the built-in menu bar. It certainly helped me use WordPress as an application, and is a welcome feature of WordPress.com sites. It struck me that as you add functionality to your website, e.g. with forums, polls, news etc, your website becomes an application for your visitors. So I started my WordPress menu bar plugin project.

The purpose of the plugin is to improve navigation efficiency for 3 groups of users:
(more…)

Tags: , , ,

WordPress Plugins – Developer’s Dream

February 1st, 2010 by Keith from shrewdies | No Comments | Filed in Function
I searched for WordPress Plugins that would help me apply structure to my own efforts.

A scary journey, but now the nightmare is over.

Now I can dream happily of a bright WordPress development future.

But, there is no time to dream. Not even time to hack together a pretty picture to decorate this article. I’m fired up for developing, but there is just enough time to let you know what the plan is.

When I finally decided on the SCB framework, I sat down to plan how to integrate my menu system, a hack of DashBar, into that structure. It looked like a project that might also suit Pods, as I would need somewhere to store menu item links.

What’s the first thing I notice in SCB? Routines to handle WordPress options and table data. But can’t I just use Pods for that?

Yes, I can!

(more…)

Tags: , , , ,

WordPress Plugin For Forum Access & More

October 4th, 2009 by Keith from shrewdies | 1 Comment | Filed in Function
I’m working on a WordPress plugin to ease access to the forum, and other parts of the website.

Easy access to website is always important, but doubly so when you are encouraging members to join and contribute comments and forum posts.

You may see changes to the navigation bar at the top of the page during this week. I’m building and testing new ideas, and I would also like your input.

Purpose of the WordPress plugin

I was inspired by the userbar that is part of this Splix theme. It adds great access and information features to the bar at the top of the page. It does not include all the functionality I need – especially as it has no functions to ease access to the forum. In fact, I was surprised to see functionality like this added to a theme, so I looked at WordPress plugins to see if they offered better solutions.

The one that best suits what I need is DashBar, but it also lacks the forum functions that I need. One advantage is that it is very well written, and can be extended to include other links. However, I wanted to add other features from the Splix userbar, so I decided to build a new plugin to create a functional, attractive access bar.

The purpose of the new plugin is to provide all website contributors, including administrators and casual visitors, with a quick way to see new information that is relevant to them, and a quick way to access that information for viewing or editing.

During this week, you may see two, or possibly three different toolbars as I pool the best ideas from the DashBar and the Splix userbar. I’ll let you know when my WordPress plugin is finished, but there are a couple of issues you can help with…

Help Form This WordPress Plugin

The first issue is a name for the toolbar / userbar / admin bar.

The second issue is that I would really love to hear your opinions on the features that are important to you in a WordPress plugin like this.

Please add your comments below, or discuss this in the WordPress functionality forum.

Tags: , , ,