Drupal: FB, YouTube, Flickr, Twitter content for Panel 3
Here is the background:
There are X number of teachers. Each teacher is a (Person) Content Type with custom fields. (I am using CCK to create additional custom fields). Each teacher has their own FB, YouTube, Flickr, Twitter account on respective websites.
My website URL looks like this:
www.example.com/all-teachers - will show basically all teachers bio - I have done this part. When a user clicks on any teacher, they should be taken to th开发者_如何学Goe below URL.
www.example.com/all-teachers/teachername - This is where I need help.
I would like to pull contents from FB, YouTube, Flickr, Twitter websites for each teacher and display using panel 3 module. ( I have already created the custom panels which is working fine).
Can somebody help as how I should go about doing this?
This is mainly a Drupal + Panels question, and what you are asking about is "context".
First, review Panels documentation, and be sure you understand the difference between an "argument" and actual Panels context. Follow whatever tutorials you find first... don't just dive into your example, unless you completely get it.
If you ask 2 different people, you may get two different suggestions.. there's no one way to do this. When I tried, I could not get the various Drupal "media" and social feeds working under Panels. So if that is still true.. if so, here is what I would do.
Panel page: /all-teachers/!teachername !teachername is the argument context should be taxonomy term name
Panels will digest that argument and provide you a whole family of context variables. You rarely work directly with the arguments... you work with the context variables. Remember that because people commonly mix them up.
Now create a Taxonomy Vocabulary, "All-Teachers" (name is unimportant). Populate the vocabulary with terms and definitions. Definitions would be the teacher's display name, "Bob Smith. term would be the teacher's "machine name".. the part you will expect to be in the URL (the !teachername).
Now create 4 different content types ( FB, YouTube, Flickr, Twitter for example). For now just use Body, as this is an example of context.
For each teacher, create 1 of the above articles of content, and in each store a LINK to that teacher's outside page... FB, YT, Flickr etc. Yes, this is just a link not "their content" but get your context working with this example first.
Now create 4 views, one filtered for each of the 4 content types, and which uses an argument of taxonomy term. Test it. The "facebook" view, when given an argument "bob-smith", does it pull up Bob Smith's facebook address?
You're halfway there - you've associated the teacher machine name with content/output. You can go ahead and add these 4 View Panes to the page's Content area, in Panels. Just pretend those URLs are actual content feed data.
Now, unfortunately, each one of these websites has their own way of sourcing in or embedding/subscribing some teachers feed. You'll need to collect all of those subscriber URLs for each of those websites. Put that content into those content nodes you tested with, for Bob Smith. You MAY need to edit those 4 content types and permit "Full HTML" oredit Filtered HTML to allow whatever is required (iframe, object, etc. if that's the case).
I may not have explained this the best, but it is a big task. Break the problem down if you have problems. For example if your teacher feeds do not seem to work, just hard-code your test to one teacher (taking context out of the problem), and hardcode it to one /node/nid if you need (taking panels out of the picture entirely).
The idea is that each of these 4 content panels will pull in the outside data and the rest - display - should be taken care of by Panels.
精彩评论