Closed aaongr closed 5 years ago
The link
is displayed only if you do not set text
as content settings
.
- name: link_nested
contents:
- name: link
type: EssenceLink
hint: true
settings:
text: My link text
The Alchemy::EssenceLink#link_title
is meant as the title
attribute on the <a>
tag created. But currently not used in the essence partial I just saw. This should be fixed actually.
What you may also want to use is an EssenceText
with the linkable: true
attribute. That way the content editor can enter the text of the link in the text field.
- name: link_nested
contents:
- name: link
type: EssenceText
hint: true
settings:
linkable: true
Probably something we should mention in the guides.
IMHO absolutely related:
Is it correct that Alchemy::EssenceLink#link_title
is not used in _essence_link_view.html.erb
or am I missing something?
It seems that only settings/text: Foo
or content.ingredient
(which is basically the link) is shown.
I would have expected something like
content.essence&.link_title.presence || content.settings_value(:text, local_assigns.fetch(:options, {})) || content.ingredient
Steps to reproduce
Create an EssenceLink and fill in the URL, Link Title and open in new window
Expected behavior
The Link Title should be shown in the preview window
Actual behavior
The URL show in the preview window as a link
Elements.yml
app/views/alchemy/elements/_link_nested_view.html.erb