One to many relationship, view using References module - drupal

I'm using the References module in Drupal 7 to do the following: I have projects and clients (content types), so that a project can belong to many clients, and a client can have many projects. I set this up using a Node reference field on the Project content type, which accepts unlimited values. What I need is a view (Views module) that shows a list of clients, and inside each one the projects that belong to it, like this:
Client 1
- project 1
- project 2
Client 2
(no projects)
Client 3
- project 45
- project 2
With links to the projects' pages.
I don't know how the view should be set up. I tried using the User aggregation option in the Advanced section of the view editor, with no luck whatsoever.

Add a contextual filter of client field in project view page. Go to client view and add Content: Nid and a Global: Custom text field. In Custom text field go to custom text rewrite results -> and select Output this field as a link. In Link path give value as page_to_list_projects/[nid].
Basically we are passing client nid as argument to the project list page and filtering projects with client nid.

Related

Prepopulate Content Type Args when going to /admin/content in Drupal 7

I created a Drupal site. The admins who will be using the site for content management have no Drupal knowledge and I have been tasked with making this as easy as possible for them. I'm creating an admin control panel and I want a quick link that takes them to the admin content page, but with the "content type" prefilled. For example, for content I have pages, events, resources, and testimonials. I want to provide them with a quick link for editing content type EVENTS only. So it would go directly to admin/content with the type filter set to "events". The URL does not currently add args or anything like that.
Anyone know of a way to do this?
yes you can do this- just use this module: Drupal admin views which supports a REGULAR VIEW for admin/content. The View is set to use ajax though- just remove this option and save it and call /admin/content then. There you will see the resulting filters in the URL (you can even set their keys to a value you like inside the view). Set back to use ajax (if you like) and use the keys in the URL for type it's simple just call /admin/content?type=YOURTYPE

Drupal 6.x Add More Module - No end to adding more

Simple question for all of you here dealing with Drupal 6.x...
With Drupal's Add More module, is there a way to configure my webform so that there is no limit on how many of a specific fields I can add more of?
Please see my image for example:
For example, I'd like to enable the user to add as many titles as they would like. Is that doable?
Unfortunately, it's not currently possible to add unlimited "add another" functionality with webforms. And if this functionality does become a reality someday, I doubt it will be backported to the Drupal 6 version of the module. From the webform modules author (quicksketch):
there is no progress on this subject. The ability to support multiple
values requires a tremendous amount of re-architecting, including
changes to the way CSVs are generated, analysis, the database
structure, and the UI (both for administrators and users). I wouldn't
expect this feature to be added any time soon.
See this thread for more information:
http://drupal.org/node/354381
I would suggest using a node and the CCK module plus rules and views to collect this information.
Assumptions:
Anonymous users can fill out the current form
You need some way of retrieving the data that is submitted
Regular users of the site should not be able to view submissions
Very loose directions:
Create a content type and add all of the fields that your current webform contains to it. CCK has the ability to store unlimited values out of the box. On the field settings page, inside the Global Settings fieldset, select "Unlimited" for the "Number of Values" field.
Give anonymous users permission to Create [your-new-content-type] Content on the Role Permissions page.
Using the Rules module, create a new triggered rule that fires on "Content is about to be viewed" with an condition "Content has type [your-new-content-type]" and an action of redirect to homepage (or a custom error page that you created). (Note: this is a bit of a performance hit. There are better ways to restrict access to this content type, but for the sake of this tutorial, this was the easiest to explain)
Using the Views module, create a new view with Style set to Table. Add each of the fields in [your-new-content-type] in the fields section. Under "Access" choose "role" and select the role that is assigned to your user. Add a "page" display, give it a Path and save. This is the page you will use to view submissions.
Optional:
Use the Rules module to send yourself (or the submitter) an email when a node of [your-new-content-type] is created.

Email to node author in Drupal 7

Drupal 7:
I need a module to append a contact form to a node of a specific content type. The form should be configurable and permit to send an email with an attachment to the node author. The form should also have a captcha. The email must not be saved in the database.
Does such module exists or do i need to develop it ?
You should be able to achieve this through the combination of the webform module, CAPTCHA module and a custom module.
Webform defines it's own 'webform' content type, but it also allows you to make other content types webform enabled by visiting 'admin/config/content/webform' and selecting the appropriate content type.
The token module provides node tokens such as nid and title which can be included as a hidden form element, but annoyingly, doesn't include the author as a token.
On the email tab of your webform, it's possible to choose a form component as the email address to send the form results to. I would create a hidden field, leaving the default value blank and then it should be fairly easy to add the node author value to it in a custom module using hook_form_alter (form id can be found by viewing source and looking for the hidden input 'form_id'). You can then use this form component in the email tab to send the results to.
The only thing I can see causing an issue is that there isn't an easy way to stop webform recording the form result in the database - I would imagine this would be achievable in a custom module without too much hassle though.
Yop, there is such a module. It's called Webform. Using Webform you can add a block form under certain node type with predefined fields and let send email directly to the node author.
Download and enable Webform 4.x
Create new from, add desired fields
Under E-mails tab for Address use token [current-page:node:author:mail]
In Form settings tab check Available as block
Configure newly enabled block (show only under certain node type + set restricted pages to the node/*/*)
Do tests
You can find printcreens and more detailed instructions here.

Component link in custom metadata on Keyword

We have a metadata schema that has 3 fields in it - 2 text fields (title & summary), one component link field.
Its being used by our keywords and the taxonomy published to the broker.
However when we assign values and publish, in the broker's [CUSTOM_META] table for the keyword, we only see the 2 rows for the two text field entries and nothing for the component link field. I was hoping to see a third row for the component link showing a TCM ID or something to represent the component linked to.
In fact, when you look at the database table design for [CUSTOM_META], it only seems to support KEY_DATE_VALUE, KEY_STRING_VALUE & KEY_FLOAT_VALUE.
Does this mean that the value in a component link field can't be published to the broker?
We where going to use this TCM to generate a link to a published page, so I guess we can change the field type to text and just ask editors to type url in or use Bart's Item Selector to pick the page itself.
This is in a Tridion 2011 SP1 env. - everything configured to be published to the broker by default, (apart from binaries and a couple of specific page types).
This is fixed in 2011 SP1 with hotfix CD_2011.1.0.79212, downloadable from:
https://www.sdltridionworld.com/Login.aspx?ReturnUrl=/downloads/hotfixes/SDL_Tridion_2011_SP1/index.aspx
(login required)

Drupal Webform vs Content Type vs Custom Module ? Which way should I go with?

I am trying to build a "small system" through which the register users (organizations) will be able to fill a form (Questionnaire). The data that the users have filled should appear on a chart for the administrator to analyze. The user can only submit the data just once but they can update it.
The problem that I have faced is the fact that Webform module is not integrated with views. Content type doesn't truly reflect the structure since the content type always contain a title .
Am I only left with the option of building a custom module? Any references for something similar ....
Your can use the Profile 2 module for Drupal 7: http://drupal.org/project/profile2
You can integrate profile fields with Views as it says under its features section on the description page: "You may use Views and/or the Search API to provide listings or searches for profiles."

Resources