How to manage relationships in the Umbraco CMS? - umbraco

I have relationships between some pages on my multilingual website.
The question is:
How to delete a relationship (note - I don't want to delete the relation type, just one of the relationship) in the CMS? (Can't see any option) Can this be done only programmatically?
How to add a relation in the CMS? Is there any way to add a relationship apart of when I copy a node?
I have added new custom relation type in the CMS (in Developer > Relation Types) and I can't see an option to add this type of relation between two nodes? Can this be done only programmatically?
Thanks

You can install a package for v6 such as Multipicker Relations - http://ucomponents.codeplex.com/wikipage?title=MultiPickerRelations&referringTitle=DataTypes
For v7 this allows editing: http://our.umbraco.org/projects/backoffice-extensions/umbraco-relation-editor
Or this may work: http://our.umbraco.org/projects/backoffice-extensions/nupickers

Have a look at the documentation for the RelationService: http://our.umbraco.org/documentation/Reference/Management-v6/Services/RelationService
And here's an example of using the RelationService: https://github.com/sitereactor/Umbraco-Lunch-App/blob/master/Chainbox.FoodApp/Controllers/Api/FoodRelationController.cs

Related

Umbraco Extending Tags

I am new to Umbraco CMS, so this question may sound silly. The requirement is to show the tags (based on a specific tag group) to editors in a dropbox, and they could able to choose these tags and save it to the article. What is the best way of achieving this?
The tag property allows free text entry. If you only want editors to select from a predefined list of options you will probably need to do this a different way. You may want to try the dropdown property with the multiple choice option turned on instead. Then you can setup the prevalues (options) ahead of time and your editors can only select from that list.
You could also create a container in the tree for your categories and then allow your admins to select the appropriate items from that list using a multinode tree picker. Here's kind of an example of how you might structure this for a blog:
Blog
Authors
Author
Categories
Category
Posts
Post
Then when an admin adds a new post you would allow them to select the appropriate authors/categories for the post using a multinode tree picker.

Meteor publish-with-relations VS collection-helpers for joins?

What's the best way to do joins in Meteor/mongo? Use one of these packages, or something else:
publish-with-relations
https://github.com/erundook/meteor-publish-with-relations/blob/master/publish_with_relations.coffee
collection-helpers
https://github.com/dburles/meteor-collection-helpers
I'm very familiar with PWR, but collection-helpers is new to me. It looks like the two are complimentary.
PWR solves the somewhat complex problem of publishing documents to the client via a reactive join based on arbitrarily complex relationships. See this question for more details.
collection-helpers appears to be a set of convenience functions added to the client to be used when traversing collection relationships inside of a template (given that the required documents have already been published). For example, if you have books and authors in separate (but related) collections, you can immediately get myBook.author.fullName inside of a template without having to type out the extra find for the author.
currently the top popular solution in atmosphere seems to be publish-composite https://atmospherejs.com/reywood/publish-composite

Symfony Embedded Relation Many2Many - linking unique fields or creating new fields

I'm using an embedded relation to allow the user to edit/add books to a library and in the same form to add/remove n authors who wrote the book within the auto generated admin.
Here is my problem: An authors name is unique, so when I enter an author that already exists the sfValidatorDoctrineUnique produces the error.
An object with the same "name" already exist.
What I want to do is catch this error and tell the form not to try to add the exisiting author anew.
Do I use the event system for that, or modify the validators or how can I do that?
thank you very much
hoodie
PS:
after some searching I found something that might be a solution but I haven't made it work yet
http://symfonyguide.wordpress.com/2009/09/28/symfony-forms-saving-process/
I my opinion you should not to add new author if it already exists.
sfDoctrineActAsTaggablePlugin do the same way. It searches for an existing tags and merge them with current (added by user from form) tags.
But here is one issue: Two authors - Aleksander Pushkin and Alexander Pushkin, is it same authors for us, but different for machine.

Linq to SQL - Returning a count from two tables

Let me just start off by saying I am very much a beginner and being self taught a lot of the stuff I do is through trial and error, so please forgive me if I seem vague or if I don't explain myself clearly.
I'm currently building an auction website with MVC. I have two tables, one for the auctions and one for bids. There is a foreign key relationship between the column AuctionID on both tables. I need to return a list of the top 5 auctions based on the amount of bids each item has received. At the moment I just want to list the auction title and the amount of bids it has received, something like this > 'A Lovely Item - 25 bids' etc etc.
I have had a go at a few things but to be honest I'm not really sure of the correct way to go about this. I'm using Linq to SQL and MVC. Any help is greatly appreciated, thanks.
If you defined the keys properly and have Bids set up as a Navigation Property of Auctions, then you should be able to use a simple combination of OrderyBy and Take:
var topFiveByBids = db.Auctions.OrderBy(a => a.Bids.Count()).Take(5);
Since you are a self-taught style, check the sample application provided by Microsoft for LINQ for more info
Located here: C:\Program Files\Microsoft Visual Studio 9.0\Samples\1033\CSharpSamples.zip
change drive C with VS 2008 installed drive

How to design a system like google base with dynamic attributes? in Ruby on Rails

I am wanting to create an application that can allow users to add products for sale.
I want to make it so that a user can add whatever type of product he/she likes and let them also create stored and searchable attributes for their products - alot like google base does.
Does anyone know of the best way to do this ie model it.
I don't really want a table for each category as this would be possibly 1000s of tables.
What is the best way to do this? has anyone got good / bad experiences of this?
Is there any plugins that does this?
Any help would be great
thanks
rick
It sounds like what you want is a tag system.
If you want something more flexible you might want to look at using a document store instead of a database, for example CouchDB.
If you don't want to keep this in a relational database I'd suggest creating a Model called "Descriptor" that would contain the ID of the item being added, the name of the attribute "Color" and the value "Red".
To help keeps things consistent you could also structure pre-set groups of descriptors (for cars: make, model, color) as well as provide auto-completes for the value entry text fields.

Resources