3

May be over thinking this but I wonder if anyone else has had to deal with a similar issue.

I am building a site which holds my PhD research. The main type of assets I'll be presenting are:

Sketches Audio files Videos Video Links

I'm am going back an forth between 1) creating individual entries for each asset , defining t's type and linking to the file 2) Adding fields to the assets themselves.

The benefit of 2) is I have no need to create unique entries which feels like additional work. The main drawback of 2) is I have no way of managing youtube links (or other links to external files) as an asset as no physical file exists in craft. I would ideally like to manage all these research elements in the same way.

These element can be viewed in various ways in craft through relatedTo. Which will allow sketches to be viewed in a sketchbook as individual sketches to be viewed in relation to a project. It seems that having them as entries (1) would make this easier, but I may be wrong.

Anyone any thoughts on this problem?


I response to Mats:

The plugin you suggest sounds perfect, Thanks.

As a specific example One type of research is a design journal. Each page is made up of a scan of the actual paper journal, Metadata, perhaps a few notes. All of which can be added to the asset. I have 2 options to create the book:

Using a structure:

  • Book (Entry type of Journal) --Page 1 (Entry type of Page) --Page 2 (Entry type of Page) -- etc

Or, an entry with a matrix

  • Book (Entry type of Journal) -- Pages (Matrix field) ---- Page 1 (Matrix block) ---- etc

But, the journal is only useful in that form so it can relate back to a physical copy (which will be handed as evidence). The pages although chronological don't necessarily represent a narrative flow. The narrative comes when I create a separate type of entry, a research project which is a way of pulling together all of the different elements. I would look something like:

-Research Project -- Overview -- Related Journal Pages -- Related Audio recordings -- Related Articles -- etc

If the journal were a structure it would be easy to use an entry field in the Research Project, select individual pages and get the name of the journal it's in (it's parent). I'm using ManytoMany plug-in to create a 2-way relationship, so when viewing journal pages you would also see what projects it's mentioned in.

If I went the matrix approach it would be tidier. But, i could't link the Project to the Matrix Block (page) within a journal. I'd instead have to relate it to the original asset. Which would be fine, but instead of a simple parent.title to get the journal name displaying on the Project page. I'd have to run another query to find what journal the asset is related to. Which seem a bit.. unsatisfactory.

I'm not so concerned about not having a unique url for the asset. I'd probably display them from the parent page in 2 ways 1) Thumbnail grid to lightbox slideshow. 2) paginated results.

I'm not sure I've come to any conclusions with this bit or writing. I hoped I would. a) Structure and slightly necessary asset wrapped in an entry or b) asset simplicity and slightly more complicated way of simulating a parent structure ... hmmm.

3

Actually, there's a brilliant plugin called Embedded Assets, which lets you manage YouTube links and other embeddable media like first rate citizen Assets in Craft. I highly recommend it.

As for the more general question of whether to go with Entries or Assets – it's difficult to give a solid recommendation without knowing more about your project and its requirements, and it'll also probably come down to choice and preference a little bit.

I'm also not totally sure where you're going in regards to relatedTo, but again – Assets are first rate citizens in Craft, and they aren't limited in their capabilities compared to other types of content like Entries or Categories – certainly not when it comes to relations. Assets can be related to Entries, Categories, other Assets – sky's the limit.

Anyway – based on what you're describing, I would probably go for an Assets-only solution, rather than having Entries wrapping Assets. When the actual content is a file, and everything else is basically metadata, this is probably far the more elegant and effective solution.

Depending on your requirements, the only thing you may have to work around is the fact that Assets have no URLs (beyond the actual file URL, of course), nor can Asset sources be assigned a default entry template like e.g. Entries or Categories. For listing templates, search results etc. you can always rely on Craft routing your template filenames as URIs and then just create a craft.assets template query to fetch the Assets you need, but if you need to link to an individual Asset, you'll probably need to create a custom route.

| improve this answer | |
  • Mats, thanks for the reply, plugin looks useful. I gave a more detailed response above. – Scott Robinson Jun 4 '16 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.