A few questions

Posted by Community Admin on 04-Aug-2018 17:42

A few questions

All Replies

Posted by Community Admin on 14-May-2013 00:00

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.

Posted by Community Admin on 17-May-2013 00:00

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.

Kind regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

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.

Posted by Community Admin on 17-May-2013 00:00

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
    

These public properties are picked up by Thunder which can Auto-Generate you a designer. You can add a designer by File > Add New > Sitefinity > Designer for exisitng widget. It will pull up a screen where you select your class and map different data types to designer components. For example Guid type can be mapped to Image Selector, Page Selector, Document Selector, Video Selector, etc. 

Here's a video on how to create a widget.

Regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

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 

Posted by Community Admin on 17-May-2013 00:00

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.

Greetings,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

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

Posted by Community Admin on 17-May-2013 00:00

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.

Greetings,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

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?

Posted by Community Admin on 17-May-2013 00:00

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>

Documentation here.

You can also load scripts via the Javascript widget. You can also go to Administration >> Settings >> Pages to change the version there but it's not tested in any jQuery version other than the one it ships with so we cannot support ugprading jQuery there.

I hope this helps.

Kind regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

where would i include that piece of code?

Posted by Community Admin on 17-May-2013 00:00

Hi Ian,

 In your masterpage preferably or any one of your widget templates.

Regards,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

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?

Posted by Community Admin on 21-May-2013 00:00

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,
Patrick Dunn
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-May-2013 00:00

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 &#64; this way JS understands the symbol but razor doesnt freak out because everything that follows it isnt correct.

This thread is closed