+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / A few questions

A few questions

15 posts, 0 answered
  1. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    14 May 2013
    Link to this post
    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.
  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  3. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013
    Link to this post
    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.
  4. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  5. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013 in reply to Patrick Dunn
    Link to this post
    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 
  6. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  7. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013 in reply to Patrick Dunn
    Link to this post
    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
  8. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  9. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013
    Link to this post
    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?
  10. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  11. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013 in reply to Patrick Dunn
    Link to this post
    where would i include that piece of code?
  12. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    17 May 2013
    Link to this post
    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
  13. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    17 May 2013 in reply to Patrick Dunn
    Link to this post
    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?
  14. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    21 May 2013
    Link to this post
    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
  15. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    21 May 2013 in reply to Patrick Dunn
    Link to this post
    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.
15 posts, 0 answered