customize simple search alfresco community 5 - alfresco-share

Alfresco simple search field searches on document content and folders as default.
Because I'm thinking of using a tag taxonomy I would like to default the simple search field to only search on tags without using the "TAG:" prefix and exclude content and folders. Content and folders can stay as a search option in Advanced search.
The default query looks like this:
cm:name cm:title cm:description my:authorisedBy
ia:whatEvent ia:descriptionEvent lnk:title
lnk:description TEXT TAG
Can anyone give me an idea how this query can be modified only to search on tags?

I'm going to assume that by "simple search" you're referring to the search box in the header bar displayed in Share. This is rendered by the Aikau widget alfresco/header/SearchBox and provides a number of options for customizations.
I think that your best option is going to be to extend the default widget with your own version and override the generateSearchTerm function. This will allow you to take the term provided (e.g. whatever the user has entered into the search box) and manipulate it with the additional advanced search text before it is used in calls to the search REST APIs.
This old blog post provides and example of extending a widget, however you should use the approach outlined in this blog post to add your custom package (rather than editing surf.xml directly)

Related

How can I have template in "Create Task" (for bug reporting) in Phabricator?

I want to have a template when people from support group want to add bugs.
Here is an example (https://github.com/photonstorm/phaser/issues/new) in GitHub that I want to implement in Phabricator if possible.
Phabricator supports customizing forms, including the 'create task' form. There are a couple of ways to go about it and they are covered in the documentation.
The simplest way to customize forms is to provide default values in the URL for the links you provide, for example, say you link to the bug submission form from your documentation. You can supply the template text as part of the link itself. This can result in long ugly URLs but that can be masked by using a url shortening service.
I'll use Wikimedia's phabricator as an example of how this works. If you want to make a link to the create task form with your template text pre-filled, you construct a url like the following:
https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?description=[insert template text here]
The other way to do this, which doesn't require you to store the template text in the url, is to edit the form and specify a default value for the description field. Editing forms is covered in the phabricator upstream documentation so I won't go into that, instead I refer you to the documentation section under the heading creating new forms.

How to make full site searchable in silverstripe?

How to make full site searchable in silverstripe.The defaults searches only the title and content but not the textfield.
Any help is accepted.
Check out https://stackoverflow.com/a/14489700/494421 for searching custom DataObjects.
There is also a robust search module that uses Lucene under the hood: https://code.google.com/p/lucene-silverstripe-plugin/ There are many configuration options, including searching custom fields.
Silverstripe does not permit to search in custom fields.
You can implement search on arbitrary Page fields and also on arbitrary DataObject pages using zirak/searchable-dataobjects module.

Creating a Drupal view with an RSS feed

I am very new to Drupal and I need a bit of help. I am working with Drupal 6 (because that is what the site uses).
I was asked to make a View that would display a RSS feed of certain parts of the website and I don't understand how to do this. I know how to create a View and that it must be set as a "feed". But I am not clear about what to do from here. From the examples I have seen (and not entirely understood), it seems you might need to to modify the arguements or fields, but in which way?
Also, what exactly does the "attach to" in the feed settings do?
You will want to create a view, and add a display of type feed using row style: node.
The default behavior will assume you want to include all fields on the node in the feed.
However, you can control the fields that are included in the feed by going to Content Management > [Your content type] > Display fields > RSS. From here there are checkboxes which allow you to select fields for exclusion when being displayed as part of an RSS feed.
The "attach to" setting allows you to select a page or block view on which to display an RSS icon that links to this feed.
Depending on the content you want to include in the feed, you will want to set a filter, most likely on node: type, and node: published.

How to create a simple company blog with a Tag-Cloud in Drupal-6?

I have to create a simple company blog within drupal-6. That means there should be only one single blog each user can post into.
What i have done so far is to create a custom content Type (blog) and a view that displays teasers of the recent blog entries with links to the full blog post.
Now i have to create a Tag-Cloud for this blog.
I created a taxonomy vocabulary for this "blog" content type and set the settings to Tags (Terms are created by users when submitting posts by typing a comma separated list.)
I also installed the Tagadelic Module and created a tag cloud with it, that works great and it displays all the Tags i entered when creating new blog entires.
But now to my problems:
First: If i click on an entry in this tag-cloud the default Taxonomy_term view is used to display the resulting blog entries. Thats bad because i would like to have it displayed the same way as in the view i already defined to show the blogs. Is there a way to use my view to display the results of the tag-cloud?
Second: On my view, below each blog-teaser should be a link to related blog entries (the ones that share the same terms). I do not have a clue how to do that.
is this even possible with the setting i have now or should i maybe take a whole other approach to create that company blog with tag clouds and related blog entries?
You should be able to solve both problems pretty easily, while keeping your current approach:
Take a look at your views list ('admin/build/views/list'). You should see a view called 'taxonomy_term (default)', which is usually disabled by default. This is an optional override of the built in taxonomy term page. You can enable this and configure it to look like the blog view you created.
Alternatively, you could leave that one disabled, but add another display of type 'page' to your already existing blog view, and configure that as an override to the built in taxonomy term. For this you'll need to set the path of that display to 'taxonomy/term/%' and adjust the display to use the term id argument as a filter (look at the above override for how this works).
You could also do it the other way round - use the default taxonomy_term override view, configure its output according to your blog view needs, and add another display for your recent blog entries to that. After this, delete your own blog view and use the new display of the taxonomy term override instead.

Drupal: can I specify a View for my search results?

I have a "Search" field in my website and I was wondering if I can assign my View to the search results, instead of using the default list.
Is this feasible ? How ?
thanks
It is possible to handle the search output by a view using the default search forms without exposing filters:
create a view of type content which displays all content types, display page
set Path: /search/node/%
add Contextual Filter "Search: Search Terms", then set "Provide default value" and "Raw value from URL" and "Path Component" to "3".
Now, every time you search for a node your view gets called instead of the default search result page because it is using the same path than the default search. The % is the argument which is handled by the Contextual Filter. Do not forget to set the filter to the 3rd component of the path which is the placeholder "%".
You can replace the default Search with a Views search instead. I haven't done this personally, but from what I've read it sounds straight forward. Create your "Search" View, then display it's "exposed filter" form instead of the default search form. More details here... http://groups.drupal.org/node/18582
Or, if you just want to make the search results look different, you can simply theme them, instead of using Views to do the searching. You can also control what fields (CCK and such) get displayed in the search results on the Display Fields > Search tab when editing the content type. I don't know the name of the template file for themeing search results of the top of my head, but if you have Theme Developer installed you can easily figure this out.
I've actually found the item "Search" in my Filters options in Views. I dunno how I could ignored it before. It actually exists, and works quite well. Solved.
You can use views to do search with exposed filters etc, but this is not a functionality that you can put on the search you have already. You can create a block in your search view and with theming replace what you got now with it instead.
This probably requires some work since the search box is usually not located in a region.

Resources