Add an existing node as a translation to another node - drupal

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. Then, i wrote a DRUSH command where I have a CSV file that contains URL Alias of both slug of English and French. I can then process that info and get the node ID of both related Node.
But I just can't see how I can't tell drupal to attach an existing node (FR) as a translation of another node (EN). Does anyone has ever wanted to do something similar?
Thanks!

Related

Sorting alfresco search by node path

Is it possible to sort search results from alfresco by the path of the node?
I know there is the PATH field, but that is a multi-valued attribute which SOLR is unable to sort on.
I know it would be possible to capture the path of the node in a custom attribute and sort on that, however there are many scenarios this would be unable to capture (e.g. if a parent folder name is changed for a locked node) so would prefer an alfresco field if it is possible
This is on alfresco version 6.1 with SOLR 6

How to search within a particular folder in alfresco

I have folders in share shared folder. Is there any way to specify share to search for a particular file in particular folder of the shared folders?
Yes, but there is no user friendly out of the box solution (I know of).
As admin, go to http://your-host.domain.name/share/page/console/admin-console/node-browser and execute a (fts-alfresco) search like the following:
PATH:"/app:company_home/app:shared//*" AND #cm\:name:"filename.txt"
This will find all files named "filename.txt" below the shared folder.
I guess you will have to customize the search UI if you want to offer that functionality in a user friendly fashion or to non admin users.
Further details are at http://wiki.alfresco.com/wiki/Search#Path_Queries
We've developed a solutions where you can search within a folder through the advanced search form: http://addons.alfresco.com/addons/alfresco-share-folder-search
It's free for download so you can look around how it's done.
In short: in 4.2.e you can send an extra param rootNode to the /slingshot/search repo webscript.
If you check the client side JavaScript in Share components/search/search.js
There is method _buildSearchParams The following params are send: site={site}&term={term}&tag={tag}&maxResults={maxResults}&sort={sort}&query={query}&repo={repo}&rootNode={rootNode}&pageSize={pageSize}&startIndex={startIndex}
So fill in the rootNode with a qnamePath or NodeRef and it will present the results of that folder.
For a possible implementation, I wrote a long post about it on the alfresco community forum .

where do I set the default node path in drupal

I set somewhere, that all new nodes should be published under 'reports' (domain.com/reports/node)
Where can I change this?
There are two possible answers. If you asked exactly what you have asked then you have added a path alias to node under admin/build/path. Or if instead of node/1 you see reports/node/1 then you have pathauto installed and you create a strange pattern reports/node/[nid].
Oh and there is a third one, that you have created a View for all nodes. This question requires clarification -- core only has a listing for promoted nodes not all nodes. Do you have Views installed? Do you have pathauto installed? What happens exactly?
The existing answer mentions the excellent module Pathauto here. From the project description:
The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a "pattern" system which the administrator can control.
Pathauto allows for all kinds of control over Drupal paths for sane URLs and better search visibility. In your case defaults could be set for /reports and special cases could be made for other content or content types.

Drupal search results filter, similar to drupal.org's search results page

Pretty new to drupal and I want to create a search results page that includes a filter, just like the one used on drupal.org (http://drupal.org/search/apachesolr_multisitesearch/test).
I've looked around for a module to do this, but haven't been able to locate one. Perhaps I'm not searching for the correct terms, but I've not had any luck.
Incase it matters, I have many nodes of content that are attached to a taxonomy of terms called "Tags" - I'd like to have the filter update the list of results based on the user selecting which "terms" to remove.
How are you accomplishing this?
TIA!
Edit:
Throwing in my install instructions for future travels:
Goto the following website: https://hudson.apache.org/hudson/job/Solr-trunk/lastSuccessfulBuild/artifact/checkout/solr/dist/
And find the nightly (Today’s date) build and download it.
Expand and rename the downloaded folder as “apache-solr-nightly”. This should NOT live in your webroot.
Download the zip here: http://solr-php-client.googlecode.com/files/SolrPhpClient.r22.2009-11-09.zip and unzip the file.
Download the zip here: http://ftp.drupal.org/files/projects/apachesolr-6.x-1.2.zip (Or the most current 6.x version) and unzip the file.
Copy the schema.xml from the apachesolr-6.x-1.2/ that was just unzipped to the apache-solr-nightly/example/solr/conf
Copy the solrconfig.xml from apachesolr-6.x.1.2/ to apache-solr-nightly/example/solr/conf
Edit the solrconfig.xml and include the following line as a child of
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
Search for and comment out the following lines
<queryResponseWriter name="xslt"
class="org.apache.solr.request.XSLTResponseWriter">
<int
name="xsltCacheLifetimeSeconds">5
</queryResponseWriter>
Change to the apache-solr-nightly/example directory and execute the solr jar
java -jar start.jar
drupal.org uses Apache Solr Search Integration (together with Apache Solr, of course).

How to store Blobs in Drupal?

I want to store PDF and Image files in Drupal. By default Drupal seems to store binary/uploaded files into the filesystem. I want to to be able to store files so that - I can have workflows, metadata, IP information and URL aliases?
Update, am still stuck at how to create URL aliases for files on the file system. Drupal only seems to allow creating URL aliases to node content.
The simplest solution for Drupal is to use the Upload module, which is in core. The upload module allows you attach files to nodes. As you note, they are stored in the filesystem.
If you want to get more complex, you can build your own content types through the web interface by using the CCK family of modules (such as the filefield module or the imagefield module). Your files are still stored on the filesystem.
You could use CCK to create the metadata field you want.
You could use the workflow or rules modules to implement workflow.
IP information is recorded automatically by Drupal's logging module (either the database logging module, which logs to the database, or the syslog module, which logs to syslog).
URL aliases for nodes are available in core Drupal by enabling the path module (or download the pathauto module for automatic creation of aliases).
I tried Drupal's Upload module, FileField as well as uploading files using FCKEditor - I prefer the last one - it is closer to my specific scenario.
Creating an alias to the file will likely require some custom code.
It's not possible to simply create an alias using the Administer > Site building > URL aliases screen. I tried inserting a record with
insert into url_alias (src, dst) values ('sites/default/files/ChipotleArt.JPG', 'here-is-the-file.jpg');
That still didn't work. So, you will really likely need to write some custom code.

Resources