How to create a new Widget Type with an icon before widget title?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jobBole
    Senior Member
    • Dec 2009
    • 142

    [CMS] How to create a new Widget Type with an icon before widget title?

    Hi, guys

    I had create a widget named Recent Message, including the latest announcements. But my user told me that, the Recent Message does not strike their eyes. So I want to add an icon to make that widget eye-catching.

    As we know, if we create a new widget with Static HTML , the new widget has no icon. (see below pic.)
    Click image for larger version

Name:	widget.gif
Views:	1
Size:	5.5 KB
ID:	3718168

    But if I modify this template: vbcms_widget_static_page to add an icon before widget title. All those widgets created with the same type would be added an icon. That is not what I want.

    I just want to add an icon in a special new widget, not all widget created with Static HTML. So I need to create new Template and Widget Type .

    I had created a new template, but I don't know how to create a widget type? Also I don't know how to make the new widget type invoke the new template?

    Thanks in advance.

    Jerry
    Best Regards,
    Jerry

  • Edwin Brown
    Former vBulletin Developer
    • Mar 2009
    • 1393
    • 5.5.x

    #2
    If you look at the widget configuration page you will see that you can edit the template name. Create a new template, copy the contents of vbcms_widget_static_page to the new template, put your icon into it, make any other changes you feel are necessary, and assign that template to your widget. If you look at the default data we install there are several of the widgets that use a custom template.
    Please- I'm not tech support. Don't send your problem reports to me unless I've asked you to.

    Comment

    • jobBole
      Senior Member
      • Dec 2009
      • 142

      #3
      Originally posted by Edwin Brown
      If you look at the widget configuration page you will see that you can edit the template name. Create a new template, copy the contents of vbcms_widget_static_page to the new template, put your icon into it, make any other changes you feel are necessary, and assign that template to your widget. If you look at the default data we install there are several of the widgets that use a custom template.
      Thanks very much, Edwin, it's Done.

      By the way, the "style" of the text field when config the Static HTML widget seems very strange. It seems more be a button, not a text field, so I never think I can assign a new template in that control.

      Click image for larger version

Name:	static html.gif
Views:	1
Size:	4.7 KB
ID:	3679591

      So, I have a suggestion, if possible, I hope change that "button" into text field, just as the below pic.

      Click image for larger version

Name:	other types.gif
Views:	1
Size:	5.0 KB
ID:	3679590

      Best Regards

      Jerry
      Best Regards,
      Jerry

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...