Welcome Visitor, Please Login or Register Now Thursday, April 18, 2024 12:07 PM 
Forums Index > Mewsoft > Documentations > Widgets API
New Topic   New Reply
Search for:
Author Message
mewsoft mewsoft's personal page
Administrator Team Member
Posts: 5381 Display member's posts
Joined: 04-18-24 12:07 PM
Location: knxoville, TN, USA
Member Offline
View Member's Profile Visit member's website Mewsoft Corporation Send private message ICQ Messenger: ICQ AIM Messenger: AIM YIM Messenger: Yahoo MSN Messenger: MSN
 
Back to top
Widgets API Edit Delete Reply with quote Quote
First Post Posted on: 01-25-19 02:14 PM last post first post


Widgets API


Begaining with Auctionawy 2012 version 15.00 a new API integration tools implemended.

The new version API includes Widgets, Gadgets, Embeded Perl code, new templates tags, new template parsing etc.


What are Widgets
=============

Widgets are small templates blocks which can be used in one or more templates or even inside other widgets.

As an example, the Head, Header, TopNav, and BottomNav widgets.

So widgets are treated as templates, you can treat widgets the same as templates, anything in the templates

you can use inside widgets, including html code, plugins, gadgets, other widgets, etc.

Widgets files are located in the themes views folder. In each theme view folder where the templates are located,

the widgets files reside also.


Types of Widgets - Theme Specific Widgets
================================

Widgets inside the themes view folder are theme specific widgets, each theme can use the widgets

inside its views folder, it can not use widgets from another theme, these widgets are called theme

specific widgets.


Types of Widgets - Shared Widgets
==========================

There is a folder called widgets in the application root folder, this is different from the widgets folder which

exists inside each theme folder. That folder is used for widgets that can be shared among all themes, widgets

inside this folder can be called from inside any theme templates or gadgets.


Creating and Using Widgets

====================

Since widgets are templates (views) blocks, to create a widget, just create it from the admin center

or create an empty html file and name it with the unique name for your widget.

To use your widget inside your theme, upload that widget file to the theme widgets folder.

To use your widget inside any theme, upload that widget file to the main widgets folder.

Calling the widgets inside the templates or other widgets like that:


[widget::widget_name::]

or use the shortcut:


[w::widget_name::]


must start with [widget:: or [w:: and must end with ::] for closing the widget tag.


Examples for the widgets are :

[widget::Head::]

[widget::Header::]

[widget::WelcomeArea::]

[widget::LogoArea::]

[widget::TopNav::]

you will find a widgets files with these files name in the theme widgets folder.

Widgets names are case sensitive so Header is not the same as header even on windows system they are same.


Widgets Arguments

==============

Even though widgets are static html or template blocks, you can insert place holders for

variables that can be passed to the widgets and replaced like you pass a variables to a function

in any programming language.


For example if you created a widget to display a different titles and messages, say the widget called hello

which contains a simple code like that:


< b >[:title:] < font color="red" size="4" >[:msg:]</ font>< /b>


Note in this widget code we inserted  the tags or placeholders [:title:] and [:msg:], now you can

pass different titles and msgs to this widgets like that:


[widget::hello (title="Good Morrning", msg="Welcome, happy new day")::]


now you can display another message with different title and msg like that:


[widget::hello (title="Good Night", msg="Welcome, how was your day, happy dreaming ")::]

As you can use, widgets are reusable, you can use the widgets unlimited times on the same template or another widgets.


You can pass unlmited argument to widgets, make sure to include the argument value inside a double qoutes and

separate among tags by commas (spaces after and before are ignored), so the general call for widgets in this format:


[widget::widget_name (arg1="value1", arg2="value2", arg3="value3", ,,,, arg_n="value_n")::]


arguments values can be of any type, strings, numbers of any type, esacaped html code, etc.


Widgets Priority
============

The template parser searchs the templates for any widgets tags, then searchs the current user theme

widgets folder for that widget file, if found will be loaded and processed, if the parser did not find a widget

file in the theme widgets folder, will go to the shared or global widgets folder to find if a shared widget with

that name exists and will use it if found, if not found will display a widget not found error message in the

widget placeholder to alret the site designer or owner that it can not find a widget file with that name.


Disabling widgets
=============

You can disable widgets tags in your templates by simply including it inside an html comment tag,

the widget parser will ignore any widgets tags preceeded by a comment tag <! --  without displaing any errors.


Widgets folders
============

As explained above, these are theme specific widgets folders and one shared widgets folder.

The application folders looks like this:

...
|-temp
|-theme-|
             |-default-
                          |-images
                          |-views
                          |-widgets   <-- this is the theme specific widgets folder

|-upload

|-widgets   <-- this is the shared or general widgets folder


Mewsoft Support
www.mewsoft.com

Page 1 of 1
Go to page:

New Topic   New Reply Mark Unread
Jump to:  
Delete   Move     Lock   +Favorits   +Notify   Print