Widgets By Flynsarmy

Widgets

$19.99

Added: August, 21, 2012
Category: Utility Modules
Version: 1.0.5 - view changes
Purchases: 5

Please log in to purchase this product.

Widgets are reusable plugins that visual or interactive functionality to your site. They require little to no code experience or expertise, making them the perfect tool for a client who wants to update his site without needing to sift through potentially thousands of lines of code in hundreds of files.

 

Usage

After creating your widget group, open the page or partial you want to place it and add the following code:

<?php FlynsarmyWidgets_WidgetGroup::create()->find(<your group id>)->render_frontend(); ?>

with Twig:

{{ flynsarmywidgets_render_frontend(<your group id>) }}

 

Just like in WordPress, you can customise the way your widget group renders. The render_frontend() method above accepts an optional array of settings:

array(
	'before_title' => '<h3 class="widget-title %1$s">',
	'after_title' => '</h3>',
	'before_widget' => '<div id="%1$s" class="widget %2$s">',
	'after_widget'  => '</div>',
)

 

Supported Widgets (so far)

This module comes with a wide variety of supported widgets. They include:

  • AddThis Social Buttons: Social media icons
  • Categories: A list of categories
  • Latest Product Reviews: Lists latest product reviews
  • Latest Products: Lists products ordered by creation date
  • Menu: Display a menu. Requires Flynsarmy's 'Menu Lists' plugin
  • PHP Code: Execute arbitrary PHP code
  • Partial: Render a given partial
  • Products on sale: Lists products currently on sale
  • Simple Contact Form: Check my blog post for this one!
  • Text: Arbitrary text or HTML
  • Top Selling Products: Lists products ordered by quantity sold
  • WYSIWYG Text: Arbitrary HTML
  • Widget Group: Display a nested widget group

 

Create Your Own Widgets

Not happy with the default selection? Add your own! The Widgets module provides a simple method of creating custom widgets. See this blog post for a tutorial on creating your first custom widget.

 

Render any Widget Anywhere

Say you want to display one specific widget in one place on your page and don't want to go through the hassle of creating a whole widget group for it. Not a problem! You can render any widget with any custom settings of your choosing with the following code:

<?php 
$widget = new FlynsarmyWidgets_Widget_AddThis(); 
$widget->render_frontend(array(
	'show_facebook' => false,
	'show_twitter' => true,
	'show_pinterest' => false,
	'show_addthis' => true,
));
?>

with Twig:

{{ flynsarmywidgets_render_widget('FlynsarmyWidgets_Widget_AddThis', {
	show_facebook: false,
	show_twitter: true,
	show_pinterest: false,
	show_addthis: true
}) ));

 

 Questions? Suggestions?

If you have any questions or find a bug, please use the contact form here and I'll get back to you as soon as possible.

Customer reviews

There are no reviews for this product.

Please log in if you want to write a review. Only customers who have ordered this product can post reviews.