Replies: 4 comments
-
How would you determine the value for each of What you're doing is emulating nested collections, something that isn't fully supported at the moment. Ultimately, it would be best to allow collection items to live in subdirectories, and set them up in
Then, a collection item's position within a subdirectory (or subdirectories) would take the place of the extra |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly! that is what I'm thinking. I find that I am resulting to that directory structure anyway to stay organized with all of my lessons. So instead of repeating myself with the variables it would be nice to setup the directory structure in config file, so I can remove all those variables from the files and update them in a single place. |
Beta Was this translation helpful? Give feedback.
-
Assuming So, for example:
Collection items are keyed by their filenames (not including any extension like Let's say you wanted to output breadcrumbs for a @php
$course = $courses->get($page->course);
$topic = $topics->get($course->topic);
$subject = $subjects->get($topic->subject);
@endphp
<a href="{{ $subject->getUrl() }}">{{ $subject->title }}</a> /
<a href="{{ $topic->getUrl() }}">{{ $topic->title }}</a> /
<a href="{{ $course->getUrl() }}">{{ $course->title }}</a> You could even generalize these variables, and just name them all |
Beta Was this translation helpful? Give feedback.
-
I ran into a similar issue... Imagine you have the following: You can do a "cars" page, you can do a collection of makes, but you can't do a nested collection of models. So, for example, if I put a file in _cars/_fiat/panda.blade.php then I would expect to be able to reach it by visiting /cars/fiat/panda. However, this currently appears to ignore the middle layer and will be called /cars/panda. |
Beta Was this translation helpful? Give feedback.
-
I find that if I have a long tree of nested objects like this:
I have to include the subject, topic, and course in every lesson file. What if this was stored in the config file somehow like this?
That way I don't have repeat all these variables in every single lesson file. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions