Un wieder ein mal ein weiteres Plugin.
SimpleWidgets soll es ermöglichen zur Laufzeit wie hier in diesem Blog an der Seite bestimmte bereich dynamisch einzublenden. Neueste Beiträge wäre ein Partial und dies kann an der gewünschten Stelle eingebunden werden.
Im Layout wird festgelegt <%= render_widgets “Groupname” %> und alle Widgets für diese Gruppe (optional) werden nun angezeigt. Caching usw alles optinal bestimmbar. In der Verwaltungsui kann man dynamisch die einzelnen Widgets passend zuweisen.
Widgets sollten beim start der Appkikation registriert werden (Durch name unique) oder können manuell angelegt werden. Das Partial muss dabei vorhanden sein!
—
You see it everywhere, simple little widgets that will be rendered (mainly on the frontpage)
into the site. E.g. Wordpress. I wanted something like that too, where i have partials that do my work and at runtime
i define which Widgets are shown. (All or special groups.)
So i define once in my layout where i want to have the widgets.
E.G. in an left sidebar i want all widgets that belong to group XYZ rendered. (Default is all Widgets)
so i define in my layout:
<div id=”sidebar”>
<%= render_widgets :name => “XYZ” %>
</div>
This will now search the widgets in the Widgetgroup XYZ and render them.
You may define them at runtime using manual defining or what i did was create an Holder.
WidgetHolder.register (in environment) registers all defined using the Method
SimpleWidgets.register_widget(”BlogEntries”, “posts/blogwidget”, :group => “XYZ”)
In the UI (/widgetgroups/show/id) you may drag and drop the widgets and they will now be shown
at the desired place.
Attention: currently an Widget belongs to exactly one group. If this is not desired, tell me, i could change this!
SVN: http://svn.sjoker.net/svn/railsplugins/trunk/simplewidgets/
No user commented in " Simple Widgets für Rails "
Follow-up comment rss or Leave a Trackback