“Excerpt Extension” widget

Allow HTML in the excerpt

Allow HTML in the excerpt

 Download the extension from wordpress.org here: Excerpt Extension

Term Posts Excerpt Extension. Additional options

Additional options

At the moment we plan three extensions and started with the first “Term Posts Excerpt Extension”. Why this as first? Here we get the most suggestions from our widget users. But first a short explanation. Primarily the excerpt sounds easy to use and good to configure. Unfortunately deceives that. If the post excerpt is configured, it is used in all placements with this preconfiguration. So the configuration should be nice. Here are the adjustments which WordPress let you do: Add the excerpt automatic-, manual and with the More tag (called teaser), include shortcodes, banner, social buttons, etc., include HTML elements, change the excerpt length in words and the more text. Depends where this configuration is done, for example in the Theme, in a Plugin, your Child Theme’s functions.php it’s nearly impossible to give stable widget options, which work for all WordPress installations.

We learned much configurations in the last year

Our problem isn’t that we had learned tried out each second issue a new core excerpt configuration in the last year. The hack is each special genius solution is not applicable to the next used special WordPress installation. Every time we wanted to install a super intelligent switch, we had to define a normal state and leave this for our majority of users. And how should it be otherwise? Basically, all attitudes can be regarded as particularly special. A definition can be:

What is a “normal state”? And is the “normal state” differently on special use?

The answer is yes, but special use is not for all users the same, because there are so many configurations. The answer is also, we’ll dig deep in custom code. If the user starts with a free or paid Theme, the Theme comes with set filters for the excerpt. Our thought is the Theme designer don’t know which widgets and plugins the user want to use and as we’ll say it: To which place you want to put your posts? As in the relation of using shortcodes, many placements are imaginable and possible. And so conflicts with the excerpt and between the Theme and installed plugins are not a rarity.

Can be the programmer’s view the right one?

In the second application case from the programmer’s view, the set excerpt filters must be overridden when using a recommended Child Theme. And we called this overriding code “custom code” and want get rid of it in our core widget code. Our solution is providing a excerpt extension.

You can download the extension from wordpress.org here: Excerpt Extension

delete double shortcode banner or social icons in the excerpt

Delete double shortcode banner or social icons in the excerpt

Extension to manage more website tasks

Bildschirmfoto 2016-12-26 um 22.55.54

We build extensions for our premium widget Term and Category Based Posts Widget. We want satisfy the many requests and also issues we get from customers with this extensions. Our problem is we have to build a stable widget with many features and possibilities. The tasks the widget should solve are easy in a single scope and when this many controls interact with each other it comes difficult. And this is what we want:

Expand to more regions and manage more website tasks.

It means not only the kind of the website, like is the website a blog, a shop or for schools or education. Also how the website was managed, updated and build. There are many approaches how a website is maintained and from how. But also this is important today for the success of a website.

 

The text content is very important. Also important are photos, design, layout, menus, submenus, low distract, trust and social enthusiasm. One of our main considerations is:

Owners of a website should be involved as much as possible when creating the content. If you need expert advice, this must also fit into the website in order to achieve the best possible success.

So we have many widget users and each have different technical skills. We don’t know if all know CSS programming, place the widget to new areas and do high-level layout improvements, imagine landing pages, cross-selling, up-selling and related-selling. Promote your courses and upcoming events.
So it comes many customer code and features together, for what we think for one it helps for many others it will harms. That’s why we outsource such features to extension. As explained we know and even expect most of our widget users are no programmers. Insert example code to the Theme’s functions.php to add filter and action hooks should no problem, but there are so many more high-level task to solve for a website. So we’ll provide programming APIs to extend the widget with your own ideas as we did, if there are needs and want give our best basic widget as possible. With the focus on single tasks which achieve much.

“Allow HTML in excerpt” becomes filter/actions code

It is never nice to the users when features are deprecated but when a feature causes too many headaches, introduces UI clutter and it is used by only very small subset of the users it is just something you can not have in a free product that is being used by many people.

Some background

WordPress core has two ways to provide n excerpt for a post when only an excerpt is needed to be displayed instead of the full content.

  • The excerpt text area in the post editing page can be used to provide a “manual” excerpt
  • An automatic excerpt can be generated from the content

The two options are not being treated in exactly the same way and while the manual text will be used mostly “as is”, no matter what content it contains, the automatic option will remove any HTML and limit the length of the generated excerpt.

While it seems like manual excerpt is the way to go whenever you need an excerpt, it requires more time to do, probably just mostly repeating the first paragraph of the post, and the lack of a visual editor for it makes it not comfortable to work with.

What was the feature about, and what is the problem with it?

We were requested to allow links to not be removed when excerpts are generated automatically. This by itself was never too hard to do, but we found that it is hard to define what is the content in this context because wordpress have two concepts of content, the raw content saved in the database, and the content which the reader sees after all shortcodes have been evaluated and other plugins manipulated it.

We can not just ignore the shortcodes because themes are doing all kind of strange thing with them and ignoring them might hide some content, but if you do evaluate them you end up with ads, share buttons and other things that are obviously not part of an excerpt.

It is just too hard to make a general solution that will work with all themes and plugins.

But what about the users already using it?

We are going to add a filter that will let advanced users the ability to write some simple (or complex) code to customize the excerpt, and do it while targeting the category posts widgets in general and even a specific widget.

The filter name is “cpw_excerpt” and it provides 3 parameters which can be used when calculating a new excerpt. Following are two examples of possible ways to use it.

The first example is an actual working plugin that adds an additional editor in the post editting screen that can be used to add excerpt specific to the category posts widgets

Keep in mind that this allows people to add raw html, therefor it is not very secure in a multi author enviroment where you do not trust your authors

The second example just shows the concept of how it is possible to target a specific widget

Use separate extensions, filter- and action hooks

IMG_0229

Users in general like features, in the same way kids like candies, the more features there is the happier they are. The best way to make a user happy is to tell him,

“Oh, you need this feature? No problem we will implement it in the next release”.

Adding features is a good way to make a specific user happy at a specific time, but the end result is usually at least UI clutter, and many times bugs, which result with most of the users not being happy most of the time.

The problem is of course to figure out what feature will make most users happy and therefor are worth adding to a product. Directly asking users about that is pointless because as said above all users instinctively want to have as many features as possible.

A possible compromise we are going to try starting with the next release (4.6) to provide WordPress “hooks” and “filters” in order to enable the creation of extensions  which can be shipped separately from the main plugin. Extensions that come into my mind as possible example, is adding sorting by price for WooCommerce sites, page views, or social shares. Filtering set to be as relevant in the context of the content being displayed. Adding tracking parameters to the url to help to figure out the effectiveness of the widget. All those examples are not something that we think that it is likely to be used by all users.

We are obviously planning to release such extensions, but this will be open for any developer that will want to further customize the widget.

Other features in the upcoming version 4.6 will be for the design of the layout of the widget and do it as a grid system. Here is a preview:

More about it and the shortcode in following posts.