Hide/Show Form elements in Alfresco share - alfresco

I am still fairly new to Alfresco and thought I was trying to do something common, but I can't figure out how to do it. My basic question: is there a simple (built-in) way of hiding or showing one field based on the value of another?
Details:
I would like to be able to do something like this in my share-config.xml file:
<field id="a:thisField" label="This Field Label">
<control template="/org/alfresco/components/form/controls/hide.ftl">
<control-param name="property">a:myCheckboxField</control-param>
</control>
</field>
This would show or hide the entire 'thisField' whenever a checkbox was checked or unchecked. Of course, there is no 'hide.ftl'! From what I have read, I gather I could write something like that to do what I want, but isn't this really so basic that it should be supported somehow? [Besides, I don't haven't had to do anything like that yet, so it would be all new.] If there is an easy way, I couldn't find it and would be grateful for any help!

There is no special support to act on one field depending on the value of another.
I guess the easiest thing to do would be to come up with a custom two-in-one.ftl housing both fields.

Related

Is there a way to hide optional fields while using autoforms in meteor

I'm using autoforms to build a rather lengthy form. SOme fields are populated by default values and I do not wish for them to appear since the end user will mostly not be touching them unless there is a specific necessity. I went through the documentation for autoforms and the demo page, but nothing is clearely mentioned about how to have these fields hidden away and then shown upon clicking on 'Advanced' or something like that. A little advice on how to get this thing going will be useful.
Documentation sources:
http://autoform.meteorapp.com/
https://www.google.co.in/search?q=afquickfieldschema&oq=afquickfieldschema&aqs=chrome..69i57.3232j0j1&sourceid=chrome&ie=UTF-8#q=afquickfield+options
Used simple collapsible s to meet this specific requirement.

Drupal 7 - Administration - Find node by it's field value

I'm looking for the way for the site's administrator / moderator to find / filter the list of nodes by some field custom value. Field value could be defined by radio / text / checkbox etc.
Default content listing proposes only few filters, it's not enough for sites with huge amount of custom nodes.
Use an EntityFieldQuery object, documented here:
http://api.drupal.org/api/drupal/includes--entity.inc/class/EntityFieldQuery/7
The documentation has no examples (ugh), but there's a thread here with some:
http://drupal.org/node/916776
EDIT: Ah, you're talking about administration and not actually writing a module to do it. If that's the case, use a view with exposed filters, like the other guy said. :)
Maybe it would help to use a view for it, where you set filters, so that you get the desired listing.
I had to test this, but I've just confirmed. Views in Drupal 7 can indeed filter across multiple content types w/ custom fields, and still have filters apply to those custom fields. They seem to treat the nodes w/o those custom fields as empty or null values.
So for instance, I have article and blog content types. Blog has images, article does not. I can sort or filter on the image field, even though article doesn't have it. It simply assumes the field is null or empty.
This however, may not solve your problem of having a large number of custom fields. If these are dynamic (i.e. they grow over time) you might be in trouble. If, however, they are set, and just a very large number, you could manage this.
So while there is no automatic add all fields, which I believe you mentioned in a previous post, you could feasibly search on a large variety of the fields. Even exposing fields that you don't necessarily display in the table, but can then search on. Or changing the fields you expose or display on a per page basis in the view. All from one view. And then you could export the view to bring it over to the other sites.
I was going to try and attach the exported view, but the export is rather large for inclusion in an answer, I think. Please let me know if you think I should still include it, or if you'd rather I can simply send it to you through a PM. Let me know!
EDIT: I decided to include a link to an export of the view. http://greggalante.com/sites/greggalante.com/files/cross_type_view.txt
http://drupal.org/project/search_api

Setting formatting on multiple controls in a InfoPath form at one time

I am creating a form that needs to have 30 or more fields either disabled or set to be read only. They need to be marked as such if the based on the value of a drop-down box.
This is something that I can do using conditional formating that I know, what I want to know is there a way to either add conditional formatting to multiple controls at once or a rule that I can set that will accomplish the same thing?
One requirement is that I can't use programming code to do this. I realize it would probably be far easier to do that way but that is a requirement given to me by my manager.
EDIT: Forgot to add this there are fields that still need to be edited when the other fields are read only.
One feature in InfoPath 2010 (can't remember if it was in 2007) that reduces the pain of this sort of repetitive work is the ability to copy-and-paste rules. With this you can create your read-only rule once and then just paste it onto each of the 30 controls that need it.
You could put it all in a section but your only option for sections is hide/show (not disable or read only). Otherwise you have to setup all the fields against that one dropdown. Huge pain but at least you only have to do it once.
An alternative, which is just about as much work, is to setup two views. One that is readonly and one that is normal. When the user changes the dropdown just flip the view. This method has a bunch of display nuances but does work.

Drupal Search in Block View

i need to create a block View with a search box attach to the header in order to search nodes for one specific content type. I don't know how to achieve this, so i ask for your help. Something like the attached photo.
I'm not exactly sure here, but it sounds to me like you want to:
Create a view;
add a "filter" which limits the view to only your desired content type;
add an "argument," and then expose this argument, for either title, body, or one of your text fields.
Unfortunately:
This alone will not search the whole node. If most of your content is in body, this would probably be a good way to do it. But, for example, if for some reason you have a title like "Bicycles in Timbuktu" with a body that does not contain the word "Timbuktu" - were your users to search for Timbuktu, this item would not appear. That said, it's probably a rather rare case, and if you are simply aiming for happy users, and not rigorous perfection, this will likely be enough.
That said, Kniganapolke's suggestion of checking out Custom Search is excellent. The advice here is more applicable if you want to do this as you've designated and using the power you have with Views (and the other possibilities they offer), rather than a more dedicated-type module. If you don't have other specifications which require you to use Views, I'd guess that Custom Search will likely be the better solution.
Have you tried Custom Search module?
If anybody is interested, i have edited the header block view and load a custom_search_block inside it.
Thanks anyway
create a view with the content you want and then filter it by content. Expose the filter.
http://beeznest.wordpress.com/2011/11/01/create-a-view-to-search-on-content-title-in-7-steps-in-drupal-7/

filtering a Drupal View with ORed criteria

I'm attempting to present a Drupal View that shows nodes in which the user's e-mail address shows up in one of two CCK text fields. Unfortunately, this doesn't seem to be possible using the stock version of Drupal's Views module - there doesn't appear to be a way to combine filtering criteria (except ANDing them), nor does their appear to be a way to do the custom logic for the filter's setting...
Is there a simple way of directly injecting additional information into a specific View's WHERE clause? If not, can it be done in another way?
You can use the views_or module. It's still in dev but looks promising.
The other option is using hook_views_query_alter with $query->add_where() you should be able to add an or clause. You can also use it to add your aditional WHERE clause that you asked for.

Resources