How to choose from images list for <img> edition? #902
-
Hi Is there a way that I would like to be able to choose from a list of a preloaded images (referenced inside a json file for example), and allow user to choose from them, instead of providing a url or uploading it each time As described on documentation here, but editor always popup mavo's window to uplad from file Does someone experienced that, or find out a solution to this usecase? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey there, @GalinhaLX! 👋🏻 Do you mean something like that: <img property="myImage" mv-editor="#imageList" mv-default="https://mavo.io/img/logo-mit.svg" />
<select id="imageList" hidden>
<option>https://i.imgur.com/LPeWcag.png</option>
<option>https://mavo.io/logo.svg</option>
<option>https://mavo.io/img/logo-mit.svg</option>
</select> Please note that to replace the default editor, we should use the Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
While I may not be interpreting your question correctly, the following
two things should work:
1) define a chosenImage property, place <img src="chosenImage"> in your
app, and use a select menu to let the user select a value for chosenImage
2) if you want them to select an image by clicking on a thumbnail, you
can put an mv-action on each thumbnail that uses set() to change the
value of chosenImage based on which thumbnail they click.
…On 8/11/2022 12:54 PM, GalinhaLX wrote:
Hi
Is there a way that |<img>| edition links to a list of url/images
(instead of Mavo popup)?
I would like to be able to choose from a list of a preloaded images
(referenced inside a json file for example), and allow user to choose
from them, instead of providing a url or uploading it each time
As described on documentation here
<https://mavo.io/docs/properties#mv-editor>,
I tried to apply it to |<img>| element: see my
|[codepen](https://codepen.io/galinhalx/pen/KKoxWeX)|
but editor always popup mavo's window to uplad from file
Does someone experienced that, or find out a solution to this usecase?
—
Reply to this email directly, view it on GitHub
<#902>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIWSXUXAIFAHF3PTTROFV3VYUV4NANCNFSM56I33N5A>.
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hey there, @GalinhaLX! 👋🏻
Do you mean something like that:
Please note that to replace the default editor, we should use the
mv-editor
attribute. And the value of this attribute is a valid selector (like in CSS) that allows Mavo to find the corresponding element on the page. That's why we use#imageList
in the code above (since we ask Mavo to find the<select>
element by itsid
attribute).Hope it helps!