So i downloaded and installed Skybrud via the umbraco packages section. Created a data type and lost as to what i need to do next? Reading the documentation im not sure if this add-on is applicable to me?
To clarify this package a bit, Skybrud.Social for Umbraco 7 adds a property editor that let's you authenticate with your Instagram account. Authentication gives you an access token, which you then can use to access the Instagram API.
Skybrud.Social for Umbraco 7 itself doesn't handle more than just the authentication, but it includes another package -
Skybrud.Social - which you can use for this.
Here is a quick example on how you can show the most recent media of a given user (653220932 is the ID of our company account). This example however illustrates a MVC partial view, as I don't have any examples for WebForms.
@using Skybrud.Social.Instagram.Objects
@using Skybrud.Social.Instagram.Responses
@inherits WebViewPage<Skybrud.Social.Instagram.InstagramService>
@{
// Make the request to the Instagram API
InstagramRecentMediaResponse response = Model.Users.GetRecentMedia(653220932);
// Get a reference to the response body
InstagramMediasResponseBody body = response.Body;
// Iterate through the returned media
foreach (InstagramMedia media in body.Data) {
<pre>@media.Link</pre>
}
}
The partial view has a model of the type InstagramService. Your MVC view could look like this:
@using Skybrud.Social.Instagram
@using Skybrud.Social.Umbraco.Instagram.PropertyEditors.OAuth
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{
// Get the OAuth information stored in the property
InstagramOAuthData instagram = Model.GetPropertyValue("instagram") as InstagramOAuthData;
// Check whether the OAuth data is valid
if (instagram != null && instagram.IsValid) {
// Gets an instance of InstagramService based on the OAuth data
InstagramService service = instagram.GetService();
@Html.Partial("~/Views/Partials/Instagram/GetRecentMedia.cshtml", service)
}
}
Again, I don't have any WebForms examples. It's mostly just C#, which works in both WebForms and MVC/Razor. So I hope the examples makes sense anyways ;)
I haven't used macros in a really long time, so I'm not sure I'll be able to help. But I think you need to inherit from PartialViewMacroPage of UmbracoViewPage:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
UmbracoViewPage is more for regular MVC views and partial views.
Getting started
Purpose: Display my insta images on site
Umbraco 7.. using webforms.
So i downloaded and installed Skybrud via the umbraco packages section. Created a data type and lost as to what i need to do next? Reading the documentation im not sure if this add-on is applicable to me?
Appreciate any help.
Hi J,
To clarify this package a bit, Skybrud.Social for Umbraco 7 adds a property editor that let's you authenticate with your Instagram account. Authentication gives you an access token, which you then can use to access the Instagram API.
Skybrud.Social for Umbraco 7 itself doesn't handle more than just the authentication, but it includes another package - Skybrud.Social - which you can use for this.
Here is a quick example on how you can show the most recent media of a given user (
653220932
is the ID of our company account). This example however illustrates a MVC partial view, as I don't have any examples for WebForms.The partial view has a model of the type
InstagramService
. Your MVC view could look like this:Again, I don't have any WebForms examples. It's mostly just C#, which works in both WebForms and MVC/Razor. So I hope the examples makes sense anyways ;)
Thanks, when i add the control to my template i get the error
"Cannot bind source type Umbraco.Web.Models.PartialViewMacroModel to model type Umbraco.Core.Models.IPublishedContent."
I've created another thread for this at
https://our.umbraco.org/forum/templates-partial-views-and-macros/91091-cannot-bind-source-type-umbracowebmodelspartialviewmacromodel-to-model-type-umbracocoremodelsipublishedcontent
in case its a separate issue from this control?
Hi again,
I haven't used macros in a really long time, so I'm not sure I'll be able to help. But I think you need to inherit from
PartialViewMacroPage
ofUmbracoViewPage
:UmbracoViewPage
is more for regular MVC views and partial views.is working on a reply...