Handling an adding new item event in Sitefinity dynamic module - sitefinity

I'm working with Sitefinity CMS. I've created new dynamic module with Module Builder (for example Products). I would like to do some actions when I add new item to content Products. Is it possible to handle that event?
I will be very grateful to someone who will help with suggestions.

the most recent release of sitefinity contains some event hooks to which you can subscribe to do exactly this.
I'm still exploring this topic and some new docs should be out soon but in the meantime you want to be looking at the Telerik.Sitefinity.Services.EventHub.Subscribe(handler) where T is the type of event you want to subscribe to (Inheriting from IEvent), and handler is your event handler containing the code you wish to execute.
like I said more info is coming soon, but hopefully this will point you in the right direction in the meantime!
hope this is helpful!

Related

Sitefinity Feather custom action form

I've got the following problem: in Sitefinity (9.1, Feather) I need a form, which can call 3rd party API (Mandrill) once submitted.
As far as I understand, I need some kind of custom widget or something.
Any help would be very appreciated.
Thanks
I would start here. You don't necessarily have to create a separate class library for creating the custom Feather widget (you can just put it in the SitefinityWebApp web project), but you can if you like. With Feather/MVC widgets you basically get a Controller and View, with an optional Model class to play with too.
In your scenario, you'd probably have a Controller with two actions: Display the form, and handling the form submission. In your form submit action you'd then call Mandrill to submit the data (or do whatever it is you need to do). In your Controller you're in C# purely, so you can do whatever you like there.

Magento Extension - Add to Cart API call

Let me start to say that I am new to Magento.
I am building a small extension that automatically injects relevant youtube videos to product pages (electronics, books, etc...) and I need to know if the user clicked the 'Add to Cart' button.
Is it possible to know when a user adds a product to the cart via an API call? Other method? Thanks in advance.
You have to write event observer for your custom extension and need to track that when add to cart event is fired you can run your own logic inside this observer.
<events>
<checkout_cart_product_add_after>
<observers>
<uniquetag>
<type>singleton</type>
<class>vendor_module_model_observer</class>
<method>updatepriceing</method>
</uniquetag>
</observers>
</checkout_cart_product_add_after>
</events>
However this is not full proof solution but this is what how you can achieve your intended task.
Good luck

Creating an interactive events scheduler

I'm attempting to create something with a similar layout to this schedule page.
See attached screenshot also.
.
So what I need is:
- "Categories" across the top of the scheduler (Vertical dividers).
- "Timeslots (07:00 07:30, etc..)" down the left of the scheduler.
User's can then add events via modal screens and assign them "Timeslots" and "Categories".
They should then appear in the Schedule in the appropriate locations.
The above mentioned example appears to be using Dojo.
I found this calendar widget but am unsure of how to get it to represent "Categories" across the top when using the "Day" view.
Is this possible with the dojo calendar widget? (I've never worked with Dojo before)
Any suggestions as to other frameworks or example's that would provide me with this functionality would be very welcome also.
I've looked at JQuery's fullCalendar plugin and it doesn't seem to provide this functionality (Would be great if someone could prove me wrong!).
After looking at Dojo's widget documentation I think the Sub-Column display is what you are looking for. So each Calendar in this case will represent a category. http://livedocs.dojotoolkit.org/dojox/calendar#sub-columns.
I don't think FullCalendar is capable of the category layout, but I think its cool enough to request: http://arshaw.com/fullcalendar/wiki/Request-a-Feature/
Hope that helps!

Where to put js code for polling tile notifications for windows8 js&html app

http://msdn.microsoft.com/en-us/library/windows/apps/hh761476.aspx
Those instructions are great, but where do I put the below code (grabbed from article above)? In my default.js file, above the app.addEventListener("activated", function (args) { line of code? Below that line? Elsewhere? Thanks Microsoft, but tell me where to put the code!
var notifications = Windows.UI.Notifications;
var recurrence = notifications.PeriodicUpdateRecurrence.hour;
var url = new Windows.Foundation.Uri("http://mytileprovider.com/tile.xml");
notifications.TileUpdateManager.createTileUpdaterForApplication().startPeriodicUpdate(url, recurrence);
Ideally this would just be a manifest setting with a dropdown of "Frequency" and an input box for the url to grab it from. That would be oh so helpful and convenient.
The answer is... it depends. :)
Where do you want to set up the tile and the polling? Is it an "always on" feature that is core to your application? If so, then put in inside the activated event for your default page (usually inside default.js). Or maybe you are adding tiles based on content that the user interacts with (i.e., selecting a stock to pin to the Start page). In that case, you would put that code inside the page that handles the user action that.
The simple answer is... inside the activated event. The real answer, as you can see, can be more involved.

dojox.mobile.ListItem Drag and Drop implementation with dojo

I have dojox.mobile.ListItem inside an dojox.mobile.RoundRectList got from web service. I need to implement drag and drop functionality for the list and handle that event.
Normal drag and drop in dojo is working fine with dojo.dnd.Source. But in mobile.ListItem I dont find any links. I'm not sure whether its possible or not.
It would be great if any one provide sample code or useful link regarding.
Thanks,
Siva.
Enable the editable property on your dojox/mobile/RoundRectList and subscribe the "/dojox/mobile/deleteListItem" when removing an item.
The explanation is here and there are examples here under EdgeToEdgeList