Archive for the ‘Form’ Category

WordPress Default WYSIWYG Editor

August 26th, 2010 by Keith from shrewdies | 2 Comments | Filed in Form, Function
My search for the perfect WordPress Default WYSIWYG editor is far from over, but at least I have a stable solution that works.

I’ve switched between NicEdit and TinyMCE for a few months. I like the simplicity of NicEdit, and had it working nicely on WordPress sites.

Then all sorts of weirdness started happening when I tried the beta of Q2A on a development site. I’d taken what I thought were sensible precautions. The site in question was new and had no visitors. I prefer to experiment with this sort of site if possible, as running development sites under localhost on my PC is not always a good representation of the real world. I had an absolute nightmare with this, and suspected all the new stuff I was trying out (beta Q2A and beta WordPress 3.0!)

Turned out it was nothing to do with the beta software, and everything to do with lousy server configuration backed up by lousy tech support from Bl** Host.

In the process of trying to get back to something that worked, I tried different settings on this site. I didn’t realize that I’d left WYSIWYG turned off here until vince told me.

For now, I’ve left tinyMCE alone. It looked like a good solution, but there are a whole bunch of formatting issues, so I’ve decided to focus on NicEdit.

I use it to make WordPress commenting better, and for Q2A. Within those setups (either of Q2A, WP, or both) there are installation and configuration options, so I’ll try to cover all the permutations.

Preparing Q2A

Q2A strips out any html code from multi-line text, so we have to tweak it. If you are uncomfortable with tweaking code, raise the issue on the Q2A site, and ask for an Admin option to disable it.

We have to edit the qa_html() function in qa-base.php, which sits in the qa-include folder. At line 84, I simply comment out the string manipulation, and set the return value to the string that was passed in:
if ($multiline) {
// $html=preg_replace('/\r\n?/', "\n", $html);
// $html=preg_replace('/(?<=\s) /', ' ', $html);
// $html=str_replace("\t", '    ', $html);
// $html=nl2br($html);
$html=$string;
}

If you do not do this, NicEdit will still work, but the HTML tags will get stripped before your questions, answers, or comments get saved.

This change will need to be reapplied whenever you upgrade or reinstall Q2A.

WYSIWYG Question2Answer

The simplest implementation is to copy the from NicEdit front page:

<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

Then paste it into the Question2Answer Admin area. All you do is go to the Layout settings, and paste the above code into the 'Custom HTML in <HEAD> section of every page:' and save the settings.

You should see that all your multi-line text boxes have a WYSIWYG display with edit buttons across the top. The buttons are disabled until you click into the textarea.

Now check that NicEdit works OK on your question, answer and comment boxes. The easiest way is to edit existing items.

This has worked successfully every time I have tried it, but there may be some formatting issues on some browsers. I will cover these in my next article.

WordPress Default WYSIWYG Editor

For most of my sites, I want both WYSIWYG for Question2Answer and for WordPress. I always wrap my Q2A theme inside the WordPress theme, so it makes sense to apply NicEdit to the WordPress header. In this setup, you do not have to also apply it to NicEdit, unless you want different editor configurations in each area.

So to make NicEdit the WordPress Default WYSIWYG Editor and also apply it to Question2Answer, simply post the NicEdit code into header.php within the HEAD tags. This also applies if you just use WordPress without Question2Answer.

Test your comments both at the article level, and (if you use threaded comments) the reply to comment level. NicEdit should work nicely, but there may be issues in some browsers. You really need to try as many browsers as possible, but certainly common ones that your visitors use. See your server logs or analytics program - Google Analytics is very good - to get a list of browsers that your visitors use.

In my next article, I will look at some of the issues that WordPress themes can cause, especially with MSIE. I'll explain how to overcome these issues, and approaches to investigating problems. I will also explain how to avoid the pitfalls associated with simply pasting the NicEdit code from their site. You will see how to create the best WordPress WYSIWYG editor.

You might notice that I do not use the NicEdit/WordPress default WYSIWYG editor that I have described on this site. That is because I intend to move all the interactive features to a separate site, and add more discussion and feedback tools. When I've done that, I will produce a complete step-by-step guide for integrating NicEdit and Question2Answer under a WordPress theme.

Let me know if you want to see it in action before you commit to these changes, and I will show you sites where it works so that you can see the improved front end.

Tags: ,

WordPress Plugin: Promotion Tool

April 2nd, 2010 by Keith from shrewdies | No Comments | Filed in Form, Function
Many of you looking for a WordPress plugin promotion tool have stumbled across my Happiness Today plugin.

You seem disappointed that the next version is where the real promotion potential lies, but the good news is that you do not need to wait.

If you have downloaded and activated Happiness Today, then you already have a tool for displaying random (or selected) promotion messages in your WordPress posts, pages or sidebar.

The main appeal of Pods is the way it makes extending the WordPress database so easy. But stored data is of little use if you cannot present it to your visitors. My first release of Happiness Today was just to prove that, like Hello Dolly does for standard WordPress, it is very easy to build a basic plugin. That basic plugin instantly demonstrates how Pods stores and displays data. In keeping with the Hello Dolly tradition, I displayed random lyrics in the Admin area – but the real life potential was always to be able to produce something simple yet useful, that can display random promotion messages to visitors.

Those promotional features are included in the current release, just not obvious. Here’s how to use Pods inbuilt features to get more from the Happiness Today plugin. Start your marketing campaign now. (more…)

Tags: , , ,

WordPress Pods: Food For Thought

March 18th, 2010 by Keith from shrewdies | No Comments | Filed in Form, Function
The data-presentation link is vital. To get the best out of WordPress Pods, it pays to study the sample that is packaged with the Pods CMS plugin, and the more advanced examples in the Pods Packages directory.

It is also vital to have a clear plan of the presentation outcomes that you need.

When describing the data aspect of my first plugin, I wrote of the importance of thoroughly analyzing the relationship between the presentation of content required, and the structure of data needed to support it. Recently, I saw a question on the Pods Support Forum that seemed to relate to this area. I was particularly interested in it because the issues seemed to be similar to matters I had encountered with my shrewdBar WordPress menu bar plugin.

The difficulty with forum discussions is fully understanding what the issues are. If one is sat with a client, or even on a video link, it is easy to mock up a quick display and discuss what the presentation should actually look like. Difficulties are compounded with cultural and time-zone differences. But, “All is one in their own way,” and the power of the Internet allows the following attempt at understanding the problem and suggesting a solution.

I hope it solves the problem it tries to address, but even if it doesn’t, I’ve learned a neat CSS trick that I’ll be using again.

Basic Pods Data Display

First, create the Pod (Pods – Setup – Pods – Add new pod) using the data supplied.WordPress Pods Table
Second, (more…)

Tags: ,

WordPress Theme Functions

January 9th, 2010 by Keith from shrewdies | 1 Comment | Filed in Form, Function
Functions and options bring flexibility to WordPress themes, but can they also over-complicate?

Flexibility is second only to speed in terms of theme importance.

There are risks when theme functionality goes too far, so you need to know where to draw the line.

Your WordPress theme is the face of your website – your front of house, if you like. Just like the real world, front of house has to present your features and benefits in your best light, and it has to direct visitors efficiently by providing comprehensive, consistent, accessible navigation.

Recent trends are to added customization options, and increase functionality. Feature that used to rely on plugins, especially custom RSS feeds and header/footer code, are now options in many themes.

Disappointed Digression
This Analytics problem highlights why my plea for keeping functionality out of themes is more than me being tetchy. A good Google Analytics plugin would recognize the need to track external links and include the necessary code. I believe at least one does this, but I will review them later. Managing the code is much more than just pasting the basic script into a box, and I believe it should be left out of themes.
If theme authors want to emphasize the importance of Google Analytics (or anything else) they can easily incorporate some Admin warnings without bloating the code for all users.

I was reminded of this today when I checked my Google Analytics, and realized the external tracking code[1] was missing. I always used to add this type of code manually to footer.php. It is very easy to do, but you must remember to change it whenever you change the theme.

To avoid disruption whenever I changed theme, I started using plugins to manage Google Analytics code, and other footer additions. Today, I realized that I can easily go to the theme options for this, and dispense with a plugin. That is tempting, as reducing plugins usually means a faster website. However, I’m not convinced that the theme option is the right place for this.

If I change my theme, I lose functionality. This cannot be right. If it was a WordPress standard, then I might accept that using an out-of-date theme could cause loss of functions. However, there is no standard here, so even if the new theme allows footer code to be added, I still have to remember to copy and paste it to the new theme.

I do wish theme authors would focus on polished presentation and nifty navigation. Give me CSS options and layout options, but please leave the functionality to the plugin authors. Better still, just move your functionality to your own plugin or integrate the features from a popular plugin that performs the same purpose.

WordPress Theme Functions: Next Steps

As we are all stuck with an undisciplined way of adding code to footers, unless WordPress produces a standard, we must ensure that we manage change properly. Footer code is easiest when managed with a plugin. If you want to save a little loading speed, use the theme options or theme editor, but be sure to have a proper change procedure for applying new themes. Such a change procedure covers preparing for and checking all theme dependent functionality, and I will write more on this later.

WordPress Theme Functions: References

Tags: , ,

Best WP Theme Service

January 6th, 2010 by Keith from shrewdies | 4 Comments | Filed in Form
I’ve just seen the best WP theme service. I’m grateful and a little awestruck.

For people to donate their time to the WordPress community by developing free themes is one thing. When the theme stands out amongst thousands as truly meeting it’s purpose, that is excellent.

Awesome Aside
Despite the spell checker setting (which is set to American in recognition of the majority of my visitors), I’m a Brit based in the UK. I do not say awesome every other sentence as a habit. When I say awesome, I mean I am awed, overwhelmed and grateful. This is out of the ordinary – and a very pleasing experience.

When the author offers first class customer service – a million miles away from the common “what do you expect when it is free” attitude – that is awesome.

You might wonder why service and support matter – surely, it is the theme performance that is most important? True, a theme must work properly and deliver superb presentation. However, even exceptional themes, if not well supported, soon fall by the wayside. A well supported theme is different – it just gets better and better – as you will soon see.

I’m testing out the Swift theme on this blog. As I mentioned last week, the best WordPress themes are usually the fastest. Swift by name, Swift by nature.

The first impression was good. It is fast, but I have not tested it fully yet. It is flexible, but I have not explored all the options yet – just enough to realize that there are sufficient options to make it possible to avoid the samey look that many themes bring.

“So why are you writing a review when you haven’t finished testing it yet?” I hear you ask.

This is not a review – that will come soon – but the level of customer service that the author offers deserves immediate recognition. So often we see bad support for WP themes (and plugins), and the excuse invariably is that customer support is not justified because the software is free. That is wrong – there is nothing more frustrating than seeing something useful fail because it’s author failed to explain properly how it works.

Contrast that ‘take it or leave it’ attitude with Satish Gandham from SwiftThemes.

First off, I could see from the site that the theme is well supported. These days, if there is no obvious author support, I tend to ignore themes. With WordPress advancing as quickly as it does, it is not worth getting locked into outmoded software. Swift was obviously supported, which is good, but not exceptional.

The exceptional customer support came to my attention this way…

I keep a ‘work-in-progress’ blog to record half-developed ideas (some say they all are :smile: ) and progress notes. It saves cluttering up the blog, and sometimes what could be Draft or Private deserves to be seen. I made a note about Swift as part of another topic, mainly as a reminder to do the Swift review once I had finished the current project.

I linked to the Swift site, and Satish soon dropped by to tell me he had a new version of the Swift WP theme available in beta test. OK, it is not remarkable that a busy website owner and theme developer should take the trouble to acknowledge a link, but it is rare enough to be pleasing.

The remarkable came when I checked the link. Not only has Satish made improvements, but he has set up a demo site where you can login and view all the new options. None of the usual “take this beta stuff and see if you can wreck your site with it”. He has taken the trouble to remove all the beta testing risk by providing a demo site. Furthermore, it is not just a meaningless 2 page spread of indecipherable Latin – this has enough content to see how a real site will look.

As you can see, I’m impressed. I’m also very grateful that there are still WordPress contributors who go the extra mile and offer exceptional customer service without charge. Truly, the best WP theme service.

Best WP Theme Service: Next Steps

Do you know other WordPress theme authors that offer exceptional service? Please share the details below. Let’s keep this to format enhancing themes, but if you want to share WP plugin customer service experiences, why not join the discussions in the Functionality Forum (start a new discussion if there is nothing suitable at the moment)

Tags: ,

WordPress Hosting Theme

January 3rd, 2010 by Keith from shrewdies | 2 Comments | Filed in Form
“Where can I get a good WordPress hosting theme?” asked Fred.

It is a question that crops up time and again. As questions go, it seems straightforward, but you have to wonder why anyone would ask a question like this.

I am assuming that Fred is starting a web business related to WordPress Hosting, and not planning a hobby site to explore and discuss the finer points of WordPress Hosting themes. In that case, we have yet another example of failure to build the foundations of a web business.

It is no use simply deciding to set up a WordPress Hosting business without being clear about the purpose and objectives of that business. People familiar with my PROSPRA method know that WordPress hosting is not a suitable purpose. Brief examples of suitable purpose are “to advise students about finding WordPress hosts that will help their research and presentation” or “to supply a website hosting service that provides new website owners with a ready-to-run WordPress site”.

Those purpose statements would be longer in the real world, but the point is they are specific to the type of customer you are seeking. Fred’s question gives us no clue about his target customer base – a common situation implying he has not defined it. If you do not define your target, then how do you find it?

It may well be, for technical guys, concerned with installing and configuring server software, that you have no part to play in defining the purpose of the web business. That is fine, but you must get your client or boss to explain the purpose in clear terms. You cannot be expected to install or design an appropriate theme if you are unsure about it’s purpose.

Wrong Way To WordPress Hosting Theme


WordPress Hosting Search.
Just type themes in this box.
There is no need to type WordPress Hosting.

Search for one, and you will find sites that list any number of generic WordPress themes, made to look like the ideal hosting theme by the addition of pictures of servers.

Follow this route, and you have a generic looking site offering a generic service. You compete directly with thousands of others, and your theme will never be memorable.

How To Choose A WordPress Hosting Theme

Accept that if you want to cover your site with pictures of servers, it is extremely easy to amend any theme to do that. So, you can start with any theme, and you need to think what other properties are important. I suggest that speed is the most important issue for a hosting business. Better still, if your purpose is to aim at a specific section of the market, you can differentiate yourself with a theme that appeals to photographers or students, or…

If you are hosting several WordPress sites, or if you will be helping clients configure their own sites, it is good to use a theme with comprehensive customization options.

Install a good, fast, flexible theme and adapt it to your needs. You will get better results than by installing a generic WordPress hosting theme.

WordPress Hosting Theme: Next Steps

You’ve seen how important purpose and objectives are, so if these are not clear, your next step is to apply some PROSPRA techniques.

If you need more help with themes, look at related articles in the Form Section, or ask your questions below.

Tags: ,

Simple:Press Forum Enhancements

October 15th, 2009 by Keith from shrewdies | No Comments | Filed in Form, Function
The Simple:Press forum plugin is one of the most comprehensive and customisable plugins available for WordPress.

Is that enough for me?

Oh, no! I have to push just that little bit further.

It started some time ago, when I wanted to include a hyperlink in a forum description. I was pleasantly surprised to see that the HTML held up fine in the forum, and links, bold text and other markups were easy to add.

I was less happy when I went back to the Admin pages to make other changes – the HTML screwed up the Admin display, and could not be edited. However, it could easily be re-typed, or edited directly in the database through phpMyAdmin, so, I left things as they were. For a while.

I was tempted to raise this with the support guys at Simple:Press. They have always been extremely responsive, and their own forum is a fine example of the best in technical support. However, a new version was in the late stages of the release process, so I thought I would wait until after it’s release.

A few days later, I had the bright idea of including some AdSense in the description. I was certain that the Simple:Press forum description was no match for the AdSense javascript code. However, I remembered how I had used the Enzymes plugin in the past to make adding AdSense code to posts very easy.

WordPress Enzymes Plugin

This is a fascinating plugin that allows so many ways of manipulating your content that it deserves (and probably needs) a series of articles to do it justice.

In it’s very simple form, it allows you to store data in standard WordPress Custom Fields and refer to them wherever you want.

I’ll cover Enzymes in more detail later. For the forum description, all you need to do is to store the HTML for your description in a Custom Field, and it is easy to display, and easy to edit.

Simple:Press Forum Description Enhancement

(more…)

Tags: , ,