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

Smart fields, concatenate urls #170

Open
daniel-gato opened this issue Aug 1, 2017 · 9 comments
Open

Smart fields, concatenate urls #170

daniel-gato opened this issue Aug 1, 2017 · 9 comments

Comments

@daniel-gato
Copy link

daniel-gato commented Aug 1, 2017

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?
@arnaudbesnier
Copy link
Member

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.

🌲🌲🌲

@daniel-gato
Copy link
Author

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

screen shot 2017-08-03 at 2 49 00 pm

Collection

screen shot 2017-08-03 at 2 49 18 pm

Details

screen shot 2017-08-03 at 2 49 35 pm

@arnaudbesnier
Copy link
Member

@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?

@daniel-gato
Copy link
Author

daniel-gato commented Aug 4, 2017 via email

@arnaudbesnier
Copy link
Member

@daniel-costa we'll try to fix this in the current sprint then!
I'll let you know once it is fixed in production.

@daniel-gato
Copy link
Author

Any news about this issue?

1 similar comment
@daniel-gato
Copy link
Author

Any news about this issue?

@arnaudbesnier
Copy link
Member

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, ...).

@daniel-gato
Copy link
Author

daniel-gato commented Dec 17, 2017 via email

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

No branches or pull requests

2 participants