Is there a why to use Domain Source but not use it as a redirect?

For example I am publishing an article from Domain 1 but I am having it show up on all domains. I don't want the links to redirect back to the source domain but instead show the site name for the source domain on the article on all the sites.

Comments

agentrickard’s picture

The purpose of Domain Source is to provide control over the canonical URL of a node. DA does not use redirects, but rather rewrites the URLs to point to the canonical URL.

In your case, you likely need a different field to indicate the "source site name" of the node.

kim.le’s picture

So there's nothing in the db for me to pull the "source site name" and I would need to create a custom field in my article content type? I'm trying to see if I can make this automatic so the user won't need to physically select the source domain (they like being lazy).

agentrickard’s picture

Right, you'd need an extra field for it. Domain Source already has a specific use.

Alan D.’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Category: support » feature

Could be nice feature.

We just were informed that our client does not want to redirect when on one particular domain, rather to render the node without redirecting and to show the source domain and to provide a link to that domain to that content (yep, duplicated view of the same node). However, using the domain specific view modes / theming, these pages are different.

agentrickard’s picture

How would we abstract this to a feature that people could use?

Perhaps by adding an optional field -- using hook_field_extra_fields() -- that only applies to the Display options for Domain Source? That seems fairly easy to do.

Alan D.’s picture

Firstly, maybe postpone until #1256368: Add 'visible' key to hook_field_extra_fields() gets in. This would allow you to set the default visibility to false.

As per the request, this would have just been a flag not to redirect, but a themable domain additional field would have been perfect. Views integration would be the logical next step.

A couple of hours after my post, our requirements changed (again...) and we have to add much more business logic to our "owner" field, namely expand it to allow a couple of the domains to specify specific owners from within that domain. So all domains are getting an Organisation node reference field, and each domain will have a default organisation assigned to it, and we'll do some custom theming to wrap this into the display of the "master" domain that shows content for all of these.

agentrickard’s picture

Yeah, thinking about this some more, disabling the rewrite feature of Domain Source seems the wrong way to accomplish this task.

More interesting, perhaps, is a generic Domain field that you could use for a variety of outputs, using field formatters.

Dave Reid’s picture

Status: Active » Closed (duplicate)

Going to mark this as a duplicate of #1684920: Add a 'domain' field type since there's a field type ready for review in that issue.