Thanks for the advice and the examples you gave. They were very helpful, and perhaps I may make a few changes in the database design before the site goes into production. The relationship I have is indeed many-to-many but could probably be expressed better like you suggested. However, I did manage to solve my problem. Your post caused me to look up a few things, and I learned what I was doing wrong.
In a many-to-many relationship, if you're trying to get a single value, you need to use first->, like so:
$page->chapter->first->num
That does what I needed. Apparently Template Toolkit doesn't require that, as I haven't had to use first with it to do the same thing.
Again. Thanks for your help. :)
In reply to Re^2: Accessing many-to-many relationships in Catalyst
by LunarCowgirl
in thread Accessing many-to-many relationships in Catalyst
by LunarCowgirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |