Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EssenceText with linkable: true to optionally reference Attachment #2096

Closed
robinboening opened this issue May 12, 2021 · 9 comments
Closed
Labels

Comments

@robinboening
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Creating an element for freely linking to any source works well by either using EssenceLink or EssenceText#settings[{:linkable: true}]. It works well until you want to display meta information in case an Alchemy::Attachment from the library is linked. Since only the URL is stored every other information is literally lost and there is no way to get to the file name, mime type or size.

Describe the solution you'd like

It would be nice to keep a reference to the Alchemy::Attachment in case of linking from an Alchemy::EssenceText, so I can still access its information.

@tvdeyen
Copy link
Member

tvdeyen commented May 12, 2021

A EssenceFile should provide you with everything you need.

@robinboening
Copy link
Contributor Author

🤦 Right! I got confused it. It does everything I need. Sorry for bothering.

Since we are talking about it... 😛 I think the EssenceLink editor UI could be improved. What I mean in particular:

Currently, the URL path to the file is shown but I think in many cases this is not great because the filename gets cut off due to limited space. I believe the editor usually doesn't care about the path, but the filename. The link_title is only visible in the overlay during adding/changing the link, but it might be important information for the editor if its set and should be visible right away.

I think the editor could benefit more if it shows

  • the filename
  • the file type
  • the title if its set

What is your opinion on that?

@tvdeyen
Copy link
Member

tvdeyen commented May 12, 2021

Linking a file is only one of the links you can put into a EssenceLink - and a very rare one, considering that you can use a EssenceFile instead.

Most of the features you miss are present on the EssenceFile editor.

The Link essence is mainly used for URLs, that's why the url is presented as the preview. I would not want to change that just for the rare use case of linking to a file.

@robinboening
Copy link
Contributor Author

Yeah, thats right. It is an edge case. I haven't thought about it carefully enough, I suppose.

I am closing this now. Sorry, again.

@robinboening
Copy link
Contributor Author

robinboening commented May 12, 2021

I am afraid there seem to be a misunderstanding. I got confused in a cascading way and didn't even notice 😆

@tvdeyen I'll try express again with other words. I hope this makes it better understandable.

A EssenceFile should provide you with everything you need.

I'd like the editor to freely choose from linking to an external website, internal page, or an internal file. This excludes the use of EssenceFile as it only supports file linking as its name suggests. But on the other side, it is the only essence actually storing a reference to the file.

As a conclusion, I can only choose between EssenceText with linkable: true and EssenceLink, but either way I won't be able to access file information in case the editor links a file.

Does that make sense?

@tvdeyen
Copy link
Member

tvdeyen commented May 12, 2021

It does make sense.

And actually with the work I started with #2061 it should be possible to do that, because with the new normalized data structure it will be possible to have a belongs to association in every ingredient.

We could rethink the link ingredient to have an Attachment related or a Page etc.

Let's reopen this as a reminder

@tvdeyen tvdeyen reopened this May 12, 2021
@robinboening
Copy link
Contributor Author

Interesting! I'll need to have a look at #2061 in more depth to fully grasp the structure, but it sounds like a good idea.

@github-actions
Copy link

This issue has not seen any activity in a long time.
Please create a pull request with a fix or ask someone of the community if they can help.
This issue will be closed in 7 days if no further activity happens.

@github-actions github-actions bot added the Stale label Mar 19, 2022
@github-actions
Copy link

This issue has not seen any activity in a long time.
If the issue described still exists in recent versions of Alchemy,
please open a new issue with. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants