craftsmancoding / assetmanager

Asset Manager for MODX Revolution
36 stars 15 forks source link

Meta Data for Asset Associations #20

Open crecorn opened 10 years ago

crecorn commented 10 years ago

Is there a way to make an image a link? If not I'd suggest it be added to the to do list.

crecorn commented 10 years ago

Just so you know. For the time being I put the link [[~00]] in the title and called it in the chunk. It works but just having a dedicated asset.link would be great and maybe an asset.description also.

I'm using your plugin to call banners on my home page sliders. It works great. (example: barerootlandscaping dot com). I'll probably adapt it for my gallery pages. Currently using MIGX.

Thanks!

fireproofsocks commented 10 years ago

You can make an asset into a link using the existing Asset snippet: https://github.com/craftsmancoding/assetmanager/wiki/Asset

It's not perhaps the smoothest way to do it, but it does work.

crecorn commented 10 years ago

I did see that but I want each image to have a unigue link.

fireproofsocks commented 10 years ago

Not sure how much more unique you need... each asset has a unique url and path, and the Asset snippet lets you display it.

crecorn commented 10 years ago

I want to make each image a link to a particular page on the website. This way when the banner slides in I can have "click here for more info" and it would take the visitor to a particular page.

I made it work by putting the link in the alt text form on each image. I use the getpageasset call to get my unordered list of images and call the link in the alt in my template chunk.

<a href="[[+Asset.alt]].......<img src="[[+asset_id:scale2w=1120]]" alt="[[+Asset.title]].......

I could be reading your wiki wrong.

fireproofsocks commented 10 years ago

An asset is not a page. If you want to link to a page, then MODX provides the "~" tags. Each asset can be assigned to one or many pages, it is not a 1-to-1 relationship, and so there is no easy way to link to a single page given an asset.

What you're after is associating meta data with each asset association. Currently, the "group" field is the only exposed meta data stored in the join table (i.e. the "group" is particular to the association, not inherent in the asset itself, so the asset can be in one group on one page and in another group on a different page). So a workaround for you might be to use page IDs as ad-hoc groups, or use aliases. getPageAssets queries the join table, so you could use that (https://github.com/craftsmancoding/assetmanager/wiki/getPageAssets).

You're really requesting a feature to add meta data (e.g. custom fields) to the assets or to the associations. Although that would offer a lot of flexibility, it's a lot of work to implement and that feature is not planned any time soon.

crecorn commented 10 years ago

Thanks for the info. Meta data would be great. Wish I knew more about programming. Either way it's still a great plug-in, I'm looking forward to your future enhancements.