I think this question is common, but I dont find a final solution.
Lets say I have a post type "event", what is the best approach to link a certain post to a certain person (speaker).
at the end i need a list of all speakers (alphabetical, according to their lastname) and of course the information of the speaker in a list of posts and single post view.
The speaker needs 4 data-fields: firstname, lastname, short-bio, weblink.
For a single event the amount of speker could be 1 ore many.
As far as I consider there a three different approaches to do this:
Custom fields
All needed custom fields are added directly to the cpt "events" using for example an acf repeater field.
the fields are blank textfields but a jquery ui script is providing an autocompleate feature with all values from the database (all firstnames, lastnames…)
Disadvantages from my perspektive: not so easy to query (especially when i have more than one speaker). The information about one certain speaker needed to give for every events.
Advantage: all information about a certain event, including the information about the speaker are editable on one page in the backend.
Posttype: "Speaker"
A second posttype named "speaker" will store all the infos about one speaker. An event could be related to one ore many speakers, for example by using the acf relationship field.
Disadvantages: all the information about the speaker are to be edit on another page in the backend. The user has first to create a speaker and second link this speaker to an event.
- question: is it possible, to include a second posttype into the backend of another posttype? For example by providing the possibility to create a new speaker inside the backend of the poststype "events"?
advantages: easy to query, easy to link a event to many speaker
Custom Taxonomy
I never tried this but maybe it is a good idea if possible.
The user can choose, add and edit a custom taxonomy providing all the informations (name, firstname, bio etc).
Is it possible to use more than one field for a custom taxonomy directly in the edit post view?
Maybe there is a final answer for this question?
I don't think their is a best approach, it depends on your need and your information architecture.
For example I may have a archive page of all speakers, so I can list all speakers and I can display the speaker's detail through the url http://mysite/speaker/ucheng. In this condition, I would prefer the post type solution.
Another Solution: Speaker User Role
What if you allow the speaker to edit their profile or upload some material for the event? If you want to do this, use default WordPress User and create a speaker role for it, so you can do some access control. Also, I can list the speakers on the frontend, and link the user to the event by using ACF.
For me, I would prefer the user role solution.
Related
i have the following case: I am building a website that has information on filmmakers and their films. I have a node type for the filmmaker, with biographical content, etc and another one for the films, with a field 'author' that references one or more of the filmmakers (since one film may have been made by several of them).
I also have a views block called 'filmography' that lists all the films whose author is the filmmaker (node) the user is seeing. Setting this up with a contextual filter was quite easy.
But now I want to present in this block along with the film name, all the filmmakers that may have made the film ('author' field in the film node) and that are different from the filmmaker being viewed. Displaying all the filmmaker nodes referenced by the author field is immediate, but I want to remove the filmmaker that I am using in the contextual filter. The goal is to get something like this:
Filmmaker 1
Movie 1
Movie 2 (with Filmmaker 2)
Movie 3
I have the notion that this might be done using views php and filtering the node references returned, but I wonder if there is an easier solution for that...
Thanks
Update: I have managed to get a result using the Views Field View module, passing the list of referenced nodes (filmmakers) as a contextual filter (node ID) and then adding another contextual filter (node ID as well) as an exclusion, and getting the default value of the letter from 'node id from URL option' (that is, from filmmaker's page the filmography view is embedded in). Keeping the question open for a while to get other, possibly more efficient, alternatives.
As I read your question, the Views Field View module popped into my mind as the obvious solution (then I saw your edit). I think this will still be your best bet. Definitely avoid using php fields as that is not a good practice in general from a security standpoint. If you are concerned about efficiency/performance, then you should just use views caching setting under the advanced options. Seems like this option is always looked over.
If you are looking for alternative options, one might be to use rendered nodes as your View style instead of fields, then use Display Suite to generate additional display modes beyond "Default" and "Teaser," create a view with the filters, then use the Entity Views Attachment (EVA) module to insert a view as a display mode field. While this is certainly a robust approach, it adds a lot of processing overhead with the rendered entities, so you definitely want to cache the results of that as well.
p.s. You might get faster/more responses over at https://drupal.stackexchange.com/
I've 3 types of users:
Author
Reader
Site Admin
What I've done so far?:
I've created Content Type named Book. Authorscreate account on my site & login & then add the information about the books they authored. I've a View with page-display named books which lists all the books which can be seen even by Anonymous user.
What do I need?
Reader should be able to pick 'x' no. of books from the this view. The no. of books a Reader can pick depends on his level Voracious Reader, Moderate Reader, Occasional Reader.
After Reader choosing Book(s), Site Admin will be see the list of books picked by all Readers.
He'll then ship the book to their address (offline) & update the status as "Shipped".
of course Readers should be able to see the list of all the books they've chosen along with its status.
How do I accomplish the rest?
Install the field collection module.
Create a new field_collection field on the user profile called "ordered books".
Edit your "ordered books" field collection and add 2 fields:
1 called book - this will be an entity reference to your books
content type. You will need the entity reference module for
this.
1 called status. This can be a list with values of "ordered" and
"sent".
Now when users edit their profile then can select which books they want.
You will need to disable the status field at this point to lock it to ordered. (Use hook_form_alter).
Then also using hook_form_alter in a custom module add some extra validation to the user profile form.
In your new validation function check what sort of user is submitting the form (Voracious, Moderate or Occasional) and how many books they have selected and raise any errors as appropriate.
When a user looks back at their profile they will see a list of books and their statuses.
You may want to look into creating a new node type called "orders" or something. This could have an entity reference to the user, and entity references to books. That way you could have a status for the order a a whole as well as the separate books, but this is just an idea - you may not need it.
I have a list named "Students" of 500 members. Email will be sent to each member. Two things in the email content will be specific to each member. First one is:
Dear Michael
Michael will be replaced by each members First Name. Second is:
Click here
Click here will have a link behind redirecting each member to different target.
Followed this How to Create a campaign in MailChimp using ASP.Net
I am able to create a campaign using API, but I need to go further with or without API.
I've done this before for an email using personalisation. I didn't send it through MailChimp but I found this article that could help you: http://kb.mailchimp.com/article/getting-started-with-merge-tags/
In your list if you add a field for the student's first name and another field for the the link then you should be able to use merge tags to add that data to wherever you want it to be in your email.
I created a custom field for a user's hometown, let's call it "field_home", that is required for every user when they register an account. They can only select certain text values from a list.
Is there any way I can add a "Hometown" column in admin/people, which lists every user's field_home value along with their user name and roles?
Thanks for any information!
I would recommend creating a new view. You can build a better view than the one provided in admin/people in no time.
Add your own custom fields, edit/cancel-account links and filtering criteria. That'd be much easier and faster.
I've installed CRM 2011 to see if I can tailor it to our business. We do repairs, I want to be able to book in a contact (client) and then a case and have the clients number and address print on the case form. All I can find are fields relevant to the case and not client, any idea on how I can select them?
To get fields from the contact onto the case form you could -
Create redundant fields on the case form for the fields that you want to port over from the contact, and then edit the mappings of the relationship from Contact to Case to map those fields to the case.
Create a web application that loads contact data and then add it to an iframe on the case form. Make it so that the web application accepts the case id in the query string of the URL so that it can look up the related contact and load its details within the web app.
Add JScript (or HTML resource in 2011) to the case form to load the contact values on the fly. You will have to use SOAP XML (or REST endpoints in 2011) messages to pull the data from the CRM service and then can inject it into the CRM case form's DOM.
Option 1 is the quickest solution but will not be realtime (only comes over when the case is first created and must be related to the contact on creation. Option 1 also adds some database redundancy.
Option 2 is the most supported realtime solution, but also requires the most work.
Option 3 is easier than option 2, but any DOM injection will likely not be supported for future releases.
EDIT
To use the mapping option, go to Settings > Customization > "Customize the System". Expand the Case item in the left hand navigation. Then click on N:1 relationships and open the relationship "incident_customer_contacts". This relationship connects the contact to its cases.
On the relationship window click on "Mappings" in the left hand navigation. This controls what fields are mapped from the case when it is created.
Click new and select the contact field from the left that you want to map to the case on the right. Repeat this for each field that you want mapped. Note that the fields need to be the same types, and if they are option sets, they will have to have the same underlying integer values for each of their options.
Now when you create a new case from a contact (or set the contact during the create), the fields should map onto the case.
Seeing as how Craig mentioned he's using CRM 2011, I felt I'd clarify that for Option 3 of Cole's suggestion, you can also use SOAP Xml against the Organization Service, or just use the REST endpoint and both will be supported. So long as you utilize CRM's Xrm.Page object to display the data on the form and don't do any other DOM manipulation, you should be fully supported.
Another Option, "Option 2b" we'll call it would be to add fields to the form for the data you want to be loaded, then add a plugin registered to the Retrieve of the case entity that would populate those fields on the fly for you. No redundancy other than the fields on the form at that point.
I would personally recommend Option 2b if possible because there will not be any lag in loading the data onto the form, and it provides for minimal data redundancy, minimal service calls, and the least amount of additional customizations.
My option is a lot easy one. All we are doing is using Dialog to create cases and in the dialog fields you can get contact detail dynamically. At the end of the form when you create new case, use this dynamic values to submit in Case form.
We get times when customer tell us that the phone number is changed since last time and this method gives you option to change customer's details on the fly and submit both in Contact Entity and Case entity at the same time.