forest-rails
forest-rails copied to clipboard
Smart fields, concatenate urls
Hello,
I would like to concatenate multiple links into a smart field:
class Forest::Venue
include ForestLiana::Collection
collection :venues
field :urls, type: 'String' do
"<a href=\"#{object.facebook_url}\">FB</a><a href=\"#{object.twitter_url}\">TW</a>"
end
end
- Any documentation available regarding the supported types for a smart field?
- Any chance it could support HTML markup, maybe a field type
HTML
?
Hi @daniel-costa, yes you can do that with your Smart Field.
The only thing you have to do now, is to configure a "rich text editor" widget on your urls
Smart Field in the Venues
collection settings.
Once in "Edit Layout" mode in the UI go to Venues Settings > Fields > urls and define the "rich text editor" widget. You'll see your links properly displayed.
🌲🌲🌲
Hi @arnaudbesnier
I'm not getting that done right where I need it.
Code
class Forest::Venue
include ForestLiana::Collection
collection :venues
field :urls, type: 'String' do
# "<a href=\"www.test.com\">#{object.facebook_url}</a><a href=\"www.test.com\">#{object.twitter_url}</a>"
"<strong>just a test</strong>"
end
end
Field config

Collection

Details

@daniel-costa, so it works well in the details. About the collection list, yes it is not well formatted, we could improve that.
For your business operations, Do you want to click on the links from the collection list?
Yes
In fact, I think this might be a recurring problem. A user profile with multiple links (social links perhaps) and we want to display all of them in a "HTML icony" way.
For me, that field is relevant only on the collections view as a space saver. It allows me to see really fast if a link is missing if the icon doesn't appear.
On 3 Aug 2017, at 4.04 PM, Arnaud Besnier [email protected] wrote:
@daniel-costa, so it works well in the details. About the collection list, yes it is not well formatted, we could improve that.
For your business operations, Do you want to click on the links from the collection list?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@daniel-costa we'll try to fix this in the current sprint then! I'll let you know once it is fixed in production.
Any news about this issue?
Any news about this issue?
Hi @daniel-costa, we have a lot of things to do right now so I can't give you any ETA for such a fix.
But I am sure you can find some workaround to see quickly in the list which social links are present or not (several Smart Fields for each social link, String Smart Field to concatenate the present social network names that are present, ...).
Yes sure I could find workarounds, but it wasn’t the purpose when I posted the problem...
On 17 Dec 2017, at 6.03 PM, Arnaud Besnier [email protected] wrote:
Hi @daniel-costa, we have a lot of things to do right now so I can't give you any ETA for such a fix.
But I am sure you can find some workaround to see quickly in the list which social links are present or not (several Smart Fields for each social link, String Smart Field to concatenate the present social network names that are present, ...).
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.