is it possible to place the twitter and facebook feeds in the Master template?
With the current solution we have to authorize every single page on the website
If you have the property on each page, I assume you're doing something like this in your template/view:
// Get the OAuth information stored in the property
FacebookOAuthData facebook = Model.Content.GetPropertyValue("facebook") as FacebookOAuthData;
That takes the property on the current page.
The fix
In your content tree, you will have a node representing the site, so if you add the property here rather than on each page, you can update your code to something like:
// Get the OAuth information stored in the property
FacebookOAuthData facebook = Model.Content.AncestorOrSelf(1).GetPropertyValue("facebook") as FacebookOAuthData;
The code will now take the current page, and then find its ancestor at level 1 (assuming that site node is the topmost node). You can put this code in your master template/view, our even isolate it further in a partial view.
In footer?
Hi,
is it possible to place the twitter and facebook feeds in the Master template? With the current solution we have to authorize every single page on the website
Hi Anders,
Yes, that is indeed possible.
If you have the property on each page, I assume you're doing something like this in your template/view:
That takes the property on the current page.
The fix
In your content tree, you will have a node representing the site, so if you add the property here rather than on each page, you can update your code to something like:
The code will now take the current page, and then find its ancestor at level 1 (assuming that site node is the topmost node). You can put this code in your master template/view, our even isolate it further in a partial view.
Hope this solves your problem ;)
Thanks, that did the trick!
is working on a reply...