Widgets

May 8, 2015 ยท View on GitHub

Up

Widgets

Widget is everything that can be injected into your page. It can be a simple javascript, or even another page. You can manage widget by accessing CMS Management | Widget Management. Widget Management

Like pages, you can also define widget's authorization type. A widget can has several slugs (separated by comma). The slugs are used to group and identify widgets.

No-CMS has several built-in widgets.

Widget name/CodeSlugsDescription
section_top_fixNoneTop section (used in Setting).
This widget usually contains another widgets
section_bannerNoneBanner (used in Setting.
This widget usually contains another widgets
section_leftNoneLeft Section (used in Setting).
This widget usually contains another widgets
section_rightNoneRight Section (used in Setting).
This widget usually contains another widgets
section_bottomNoneBottom Section (used in Setting.
This widget usually contains another widgets
left_navigationNoneLeft navigation, usually put under Left section
top_navigationNoneComplete top navigation + Quicklink
quicklinkNoneQuicklink without complete menu
loginsidebar, user_widgetLogin form
logoutsidebar, user_widgetLogout link
static_accessories_slideshowNoneSlideshow (You can manage the slideshow by accessing:`CMS Management
static_accessories_tabNoneTabbed Content, usually put on main_index navigation (You can manage the tab content by accessing: `CMS Management
static_accessories_visitor_countNoneVisitor counter (You can get more detail visitor information by accessing: `CMS Management
social_pluginsidebarLink to share the page to any social media
google_searchsidebarGoogle Search
google_translatesidebarGoogle Translate
calendarsidebarCalendar
google_mapsidebarGoogle Map (edit to point to different location)
donate_nocmsadvertisementA simple buy me coffee button
blog_newest_articlesidebarNewest article from blog module
blog_article_categorysidebarCategories from blog module

Put a widget:

  • To put a widget in a desired location for every pages, you can use Setting.
  • To put a widget as a content of your page, you can use Navigation Management and edit the static content.
  • More advance designer/programmer might also like to edit the theme file directly. To do this, please refer to designer's theme guide

Widget tags:

  • You can put a single widget by using {{ widget_name:your_widget_name }}. E.g: {{ widget_name:logout }} will be parsed into logout link.
  • You can also put a group of widgets by using {{ widget_slug:your_widget_slug }}. E.g: {{ widget_slug:user_widget }} will put both login form and logout link (however only one can appeared at a time, since login widget only appeared to unauthenticated visitor, while logout widget only appeared to authenticated user).
  • You can even put widget as part of your page by editing your page static content.

Tutorial

Let's add new widget

  • Open Complete Menu | CMS Management | Widget Management or CMS Management | Widget Management. There is already several built-in widgets

  • Add new widget by clicking Add Widget

  • Set Widget Code into my_widget

  • Set Static into active

  • Set Static Content into

        <strong>Hello there</strong> 
        <p>you can put html tags, and even a black cat here:</p>
        <embed src="http://s3.amazonaws.com/wbx-files/maukie.swf" width="330" height="400" type="application/x-shockwave-flash" id="widgetbox_widget_flash_0" name="widgetbox_widget_flash_0" allowscriptaccess="sameDomain" bgcolor="FFFFFF" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer">
    
  • Set Slug into sidebar

  • Click Save and Go Back to List

Now look at the right side of your site. There should be a black cat appeared (if you have flash player).