BuildFire Pass Data Between Plugin Admin to Widget - buildfire

I previously had asked this question on how buildfire.localstorage is not passing data from the plug-in admin to the widget: BuildFire LocalStorage Not Saving Between Admin and Widget
Outside of localstorage, what are suggested ways of passing data between the plug-in admin and with widget in BuildFire?

Related

How can I customize Yesod Login page?

I implemented Google authentication in my Yesod application.
When I open http://localhost:3000/auth/login I see a page generated by Yesod.
I tried to add login.hamlet to templates folder but it didn't override default login page.
Which is the right way to customize login page in Yesod?
You can override the classes methods listed here https://www.stackage.org/package/yesod-auth
For example if you want to change the default email login page, you can do in Foundation.hs
instance YesodAuthEmail App where
...
emailLoginHandler = myEmailLoginHandler
and then look here to see how to implement it https://www.stackage.org/haddock/nightly-2019-08-26/yesod-auth-1.6.7/src/Yesod.Auth.Email.html#defaultEmailLoginHandler

Orchard - How to understand if I'm calling from Admin panel

I need to execute some code everytime I load a page, except if the page belongs to the admin panel. I created an IActionFilter and in the OnActionExecuting method I tried to check for the Controller name, but it isn't an optimal solution because there are a lot of different controllers being called from the dashboard. Is there a more efficient way to recognize if I'm loading a page of the admin panel?
Yes there is
using Orchard.UI.Admin;
&
if (AdminFilter.IsApplied(filterContext.RequestContext))
{
// This is an admin page, do nothing
return;
}

How can i check if user is logged in from the MVC5 Layout file

I have an MVC 5 Site, using a shared _Layout view.
In this _Layout view i render my scripts in the bottom part, after the body.
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/jqueryui")
#*BootStrap must be loaded after JQuery UI in order to override the tooltip function*#
#Scripts.Render("~/bundles/bootstrap")
#Scripts.Render("~/bundles/jqueryval")
#Scripts.Render("~/bundles/Session")
My Problem now, is that i want to include the Session Bundle in every page, except my Login pages.
In other words, i want to use the Session Bundle only for pages where the user is logged in and they have an active session.
How can i check for this condition in my _Layout View and render the Script Render conditionally?
In other pages, i would add a bool field to my Model and then use an C# If construction to only render the Script part if true, but i do not have a Model in my _Layout View.
I am also using custom, very simple login methods, so i am not using the Identity Framework of MVC5.
EDIT
I was suggested to use the Request object
#if (Request.IsAuthenticated) { #Render...}
This does not work since im using custom login, that does not work with the built in framework.
I read up on how this field works, here How does Request.IsAuthenticated work?
The problem is still unresolved
#if (Request.IsAuthenticated)
{
// Render stuff for authenticated user
}
I found an Answer.
access session variable from layout page ASP.NET MVC3 RAZOR
I am able to access the Session object from my Layout. Using that, i can check if my custom authentication object is null. If its not null, the user is logged in
#if (Session["BrugerSession"] != null)
{
#Scripts.Render("~/bundles/Session")
}

Displaying additional profile fields that are synced with AD using JavaScript

Along with the thumbnail photo, I may want to display other properties in my master pages that are imported from AD such as "company" using User Profile sync
If I use SPServices.SPGetCurrentUser() (https://spservices.codeplex.com/documentation), I can get selected properties held in user profile settings. However, I can't make this call since the property does not exist here (yet).
var company = $().SPServices.SPGetCurrentUser({
fieldName: "Company",
debug: false
});
It is however, is displayed both in http://mysite.mydomain.com/_layouts/EditProfile.aspx when in Mysite and _layouts/ProfAdminEdit.aspx (Edit user properties in Central Admin). I guess my question is then to be able to use SPServices, do I somehow edit the default properties and include my "Company" attribute held in the user' mysite profile? Alternatively, is there another way to access the properties held in the user profile with JavaScript ?
Thanks
Daniel
$().SPServices.SPGetCurrentUser calls this page : http://you.site.com/_layouts/userdisp.aspx?Force=True&1376982818371. For me the function is not able to parse the page correctly, but you could simply use jQuery (or pure JS or whatever) to get by yourself the same page, and then parse it to find the data you want.
Otherwise you can use $SP().people() to query the User Profile Service and gets the info for the user. See the example from the provided link. In theory that should return you the same information or even more info.

How to customize the title link of an object when publishing a open graph action?

I have successful published an action with an object on FB Open Graph. The object includes picture, title (is a link) and description. When I click the title link, it goes to the page from my web server which hosts the data of all the meta tags.
My question is how I can customize this link to open my facebook app instead of opening the object web page.
I have seen many open graph contents. When I click the object title, it asks me to install the app. I just want to do the same thing.
Just began to do facebook integration. It might be a too easy question, but I really appreciate if you can help.
Go to your Facebook App Dashboard:
https://developers.facebook.com/apps//summary
If your app is iOS, fill out the Native iOS App settings:
Bundle ID: Your bundle ID
Facebook Login: Enabled
Deep Linking: Enabled
For more details, see: https://developers.facebook.com/docs/howtos/link-to-your-native-app-ios-sdk/
If your app is Android, fill out the Native Android App settings:
Package Name: Your launching activity's package
Class Name: Your launching activity's class (full class name)
Facebook Login: Enabled
Deep Linking: Enabled
For more details, see: https://developers.facebook.com/docs/howtos/androidsdk/3.0/link-to-your-native-app/

Resources