 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Admin Admin
RE: Related subjects per Guide [ reply ] 2009-09-14 23:29
|
Ahh. Hard to decipher without context.
If you are on the guide's page then you have the variable
@guide that will return the guide.
Then
@guides.subjects will return an array of the subject objects that you can loop through and call subject.subject_code or subject.subject_name to get the code (BUS) or name (Business)
Are you trying to get non-library ala carte pages? If not then there is a method that can get a guides related ICA's
@guide.related_pages
hope that is what you were after.
|
By: Ian Chan
RE: Related subjects per Guide [ reply ] 2009-09-14 23:19
|
Hi Kim,
Sorry but my post didn't get to what I was looking for. Is there an a la Carte existing variable that I can print as text that will give me the Subjects for the guide?
|
By: Admin Admin
RE: Related subjects per Guide [ reply ] 2009-09-14 22:45
|
Hi Ian,
I assume you will need to write an sql query if this is in a Drupal view. If so then ...
Guides have many subjects through the guides_subjects table (a join table).
You would query the guides_subjects table using the guides id to find all the subject ids. You would then use that list of subject ids to query the subjects table for the subject code or subject value.
If you want to do this in rails in would be pretty straight forward by mimicking how pages are related to guides.
|
By: Ian Chan
Related subjects per Guide [ reply ] 2009-09-14 19:23
|
How do I a list of the subjects associated with a guide in plain text within the public template for an srg?
I have a Drupal Views widget to insert to the left column of each subject guide. The widget only needs the subject of the guide to then pull up a list of related course guides via Drupal. However, I don't know how to grab a list of the subjects for each guide.
Thanks!
|
|
 |