This makes it possible to have multiple blogs across multiple sites, but am just wondering if there is any facility to share posts between sites?
for example If I have the main blog at Site A, which will show all posts, I then want some of these posts will be tagged with the tag 'Site B'. On Site B I just want to list any posts tagged with 'Site B', similiar to how uBlogsy works when you're on the main uBlogsy node, like this: blog/?tag=Site B
I guess really I just want to know if its possible to have one uBlogsy post Repository, which you then share posts between sites using the tagging functionality.
You probably already know the id of the "repo" blog node. You can pass that id anywhere you see the the GetPosts() method. Currently the method taks Model.Content.Id.
So add a category or tag (which ever you choose) to each post. I should just work.
After much head scratching and changing of uBlogsy's cshtml files to reference a static node Id, I eventually found that just changing this in uBlogsyBaseSite.master:
var BlogNode = Model.NodeById(8601); // was using Model.Id before change var landing = uBlogsy.BusinessLogic.DataService.Instance.GetLanding(BlogNode.Id);
was enough to acheive what I wanted to... (no need to alter any of uBlogsy's original cshtml files)
is this like the one variable to rule them all :)?
I never actually considered doing that... GetLanding() is used all over the cshtml files... it's value is cached by the first call to it. I guess doing it your way means that the value is cached at that instance of the call.
I find that interesting since it is in the base master page. I wonder if this is a reliable way of doing things.
For multi-region sites, you normally set the hostname in the root node of each region. uBlogsy landing can either be a node under the root, or the root itself.
What Tim was talking about though is something different.
Hi Anthony, I guess my question is more related to how I would set up multiple blogs with a different master template for each blog post so the user didn't have to switch templates when they created a blog post under the second site.
Does this make sense? I hope I'm not just missing something simple here.
Backoffice editor creates a blog post under region A, which automatically uses template X
Backoffice editor creates a blog post under region B, which automatically uses template Y
If that is the case, then it will require some custom code. You'll have to write something for an event hook which will change the template on the creation of the blogpost based on crawling up the tree to find the root node.
Is there a way to check for the parent node in razor in a razor view and switch the template inheritance? Basically everything is exactly the same except the inheritance which has the logo, stylsheets, etc.
Share posts between different sites in uBlogsy 2.1.1.2
Hi There,
have read up on a previous post about how to use uBlogsy in a multi-site environment:
http://our.umbraco.org/projects/starter-kits/ublogsy/ublogsy-razor-blog/23243-Multi-site-support
This makes it possible to have multiple blogs across multiple sites, but am just wondering if there is any facility to share posts between sites?
for example If I have the main blog at Site A, which will show all posts, I then want some of these posts will be tagged with the tag 'Site B'. On Site B I just want to list any posts tagged with 'Site B', similiar to how uBlogsy works when you're on the main uBlogsy node, like this: blog/?tag=Site B
I guess really I just want to know if its possible to have one uBlogsy post Repository, which you then share posts between sites using the tagging functionality.
cheers for any help,
- Tim
It's possible.
You probably already know the id of the "repo" blog node. You can pass that id anywhere you see the the GetPosts() method. Currently the method taks Model.Content.Id.
So add a category or tag (which ever you choose) to each post. I should just work.
After much head scratching and changing of uBlogsy's cshtml files to reference a static node Id, I eventually found that just changing this in uBlogsyBaseSite.master:
was enough to acheive what I wanted to... (no need to alter any of uBlogsy's original cshtml files)
is this like the one variable to rule them all :)?
- Tim
btw, thanks very much Anthony, uBlogsy is awesome sauce.
I never actually considered doing that... GetLanding() is used all over the cshtml files... it's value is cached by the first call to it. I guess doing it your way means that the value is cached at that instance of the call.
I find that interesting since it is in the base master page. I wonder if this is a reliable way of doing things.
Anthony, could you elaborate a little bit on the ideal setup for this with MVC? Do I even need to set Culture and Hostnames on the blog?
Hi Amir
For multi-region sites, you normally set the hostname in the root node of each region. uBlogsy landing can either be a node under the root, or the root itself.
What Tim was talking about though is something different.
Hi Anthony, I guess my question is more related to how I would set up multiple blogs with a different master template for each blog post so the user didn't have to switch templates when they created a blog post under the second site.
Does this make sense? I hope I'm not just missing something simple here.
So you want to do something like the following?
Backoffice editor creates a blog post under region A, which automatically uses template X
Backoffice editor creates a blog post under region B, which automatically uses template Y
That's exactly the situation I'd like to achieve.
Is there a way to check for the parent node in razor in a razor view and switch the template inheritance? Basically everything is exactly the same except the inheritance which has the logo, stylsheets, etc.
So if you have a base template, you want to change the template which the post is inherited from?
That's a no.
You can define multiple Post templates, which each inherit from different base templates. Then switch the post templates.
If you're using umbraco 4.10+ then you can do it via router hijacking http://our.umbraco.org/documentation/Reference/Mvc/custom-controllers
Otherwise, you could do it on the save event in a handler.
There's no way to do it in razor, and it doesnt make sense to do it there anyway.
is working on a reply...