A few questions
So i have just started working with sitefinity and C#. I have a few things i want to build such as a news feed widget but can i make this with a module and make it upon post it pushes the data to facebook as well? Also on the back end is it possible to in the widget editor on the page to add and subtract attributes like images to a widget. We have non profits that we support and i would like the ability to easily add or delete their logos from a slider. Or would this be easier done with a module.
Hello Ian,
Welcome to Sitefinity!
We already have a module for News. If you're looking for increased functionality to the existing News module you can add/remove custom fields by going to Content > News and in the right-hand panel you will see the additional fields option where you can add/remove custom fields such as images. Adding/Removing fields will automatically update the backend inserts so you can use the custom fields. To display the custom fields on the frontend you would just need to modify your template to include them. Most fields can be added with an Eval() statement so something like <%# Eval("CustomFieldName") %> would display it.
As far as pushing to social networks you can do this through our Publishing system. You can see that in Administration > Feeds &Notifications.
I hope this helps.
Thanks that actually does help a lot. I know a lot of features such as maps for events and things like that are much better if not new in 6.0... Is it possible to on the back end when editing attributes of a widget to have it dynamically load more or less things such as having a slider that scrolls images across the screen and be able to add more or less images at any time.
Hello Ian,
That dynamic data is controlled by a designer. It seems like you're talking about a banner widget... something that you can add/remove images from dynamically to show on the frontend. If so, definitely possible. There are a couple on the marketplace already from third party developers. We also have a blog post on this.
Essentially when you create your widget you will specify public properties.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI.WebControls;
using
Telerik.Sitefinity.Security;
using
Telerik.Sitefinity.Security.Model;
namespace
SitefinityWebApp.Custom
public
class
MyCustomBanner : SimpleView
public
Guid ImageA
get
;
set
;
public
string
ImageAText
get
;
set
;
//override InitializeControls as well
I actually havent used the thunder program yet. It said it couldnt install on my system. I think it may be slightly a banner but not like the Nivo Slider it is more of a parade of images. You can see an example on our old site PrimalWear.com at the bottom just above the footer on the home page. But i think what you are saying is it is possible
Hello Ian,
You may be using Visual Studio express then? It should work with visual studio 2010 and up if it's not express.
But yes that's entirely possible from a few different approaches. If you just need a list like that then you can create a custom module through Module Builder. This will generate a list view based widget for you based on the fields you selected which you can style using CSS/JS to get the appearance/mobility of your example. You could then use tags/categories as a filter mechanism and the module builder has image fields. Either this way or a widget would work it just depends on how you feel comfortable approaching it.
Yes im in 2012 express...But i was actually thinking if i built a module the module could handle the loading and unloading of the images and then pass them through a widget using the api and load them into the javascript that will make then slide
Hello,
That would explain the extension problem then. Thunder is definitely a powerful tool while developing for Sitefinity so if you have the ability to upgrade to a higher version of visual studio I would definitely suggest it.
Your approach would work. Especially if you wish to persist a larger amount of data in terms of number of images, fields, etc. When you create a module through module builder it will also give you a code reference for how to access that new data via the API.
Thank you that helps me a lot. DO you know if in 6.0 they fixed anything to do with how javascript files internal or external get loaded?
Hi Ian,
It still operates the same way. Meaning if you want to include jquery it's best through resource links like this:
<
sf:ResourceLinks
ID
=
"resourcesLinks"
runat
=
"server"
> <
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/> </
sf:ResourceLinks
>
where would i include that piece of code?
Hi Ian,
In your masterpage preferably or any one of your widget templates.
Regards,So when putting an @ symbol into a javascript portion of code such as
$("#filter").tweet(
count: @Model.Tweets,
filter: function(t) return ! /^@\w+/.test(t["tweet_raw_text"],
username: '@Model.TwitUser'
);
how do you get around the system thinking that is Razor and the beginning of a code block?
Hi Ian,
I am a bit confused as to what you're trying to accomplish here. Javascript syntax in Sitefinity is no different than the syntax in any other asp.net application.
All the best,Hey Patrick,
I actually got this one figured out. Within the JS when i need to use the @ symbol but dont want to actually call out razor i have to use the @ this way JS understands the symbol but razor doesnt freak out because everything that follows it isnt correct.