Skip to content

Create an Embedded Asset by Passing a Url via template Code #266

@brianrivet-tilt

Description

@brianrivet-tilt

What would you like to see added to or changed in Embedded Assets, and why?

Hi,

I don't know if this would be any sort of security hazard or anything like that, but it might be nice to have the ability to pass a url via template code into the plugin and have the plugin attempt to create a new embedded asset from the url and return either the id of the newly created asset if successful (or the asset itself for that matter) or 0 (or some other error code) if the attempt to create the asset fails for some reason.

Here's a use case, you have an array of items, some of which are entries etc. in the system and some are external urls, but you want to display them as say cards with an image, title and description. For the entries from craft that is easy because the element can have those fields on it, but for the remote urls, you don't, but if you load them as embedded assets, then you most likely do as long as they are defined at the source. The problem is you have to create the embedded assets for those urls first, which would be recreating work from where you created the list in the first place (for example, creating a navigation list that has a mix of entries and remote urls but no extra fields for things like an image, description, etc.)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions