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

Complex Field: Show field value on Entry #27

Closed
doup opened this issue May 17, 2016 · 8 comments
Closed

Complex Field: Show field value on Entry #27

doup opened this issue May 17, 2016 · 8 comments
Labels

Comments

@doup
Copy link
Contributor

doup commented May 17, 2016

It would be usefull to show a (user defined) fields value on an entry when it's collapsed.

cf-complex-label

@doup
Copy link
Contributor Author

doup commented May 20, 2016

Indeed, it would be cool to be able to define an underscore template so that some logic can be embedded.

@tyxla tyxla added the feature label May 31, 2016
@tyxla
Copy link
Contributor

tyxla commented May 31, 2016

Folks, this sounds like a really useful feature.

Care to provide a prototype implementation, and/or a vision of how you'd expect it to be defined from the developer's perspective?

@tschortsch
Copy link

I created a prototype for this here: tschortsch@f0beb59. Right now I just tested it with Fields of type Text.
It has to be checked / enhanced for all the other field types. I could do that but first I wanted to know if I go in the right direction?

@doup
Copy link
Contributor Author

doup commented May 31, 2016

Thanks for taking the initiative!

What do you think about the idea of using an underscore template? I was thinking on the case where there is a name and surname field and we want to show both of them on the header. Something like:

Field::make('complex', 'staff')->add_fields([
    Field::make('text', 'name'),
    Field::make('text', 'surname'),
])->set_header_template('{{ surname }}, {{ name }}'); // or set_title, set_header…

It would be nice also to support images and other data types… but I'm not sure how doable and desirable it is as a feature. I can imagine use cases where having the image in the header can be a nice touch, but if the JS API it's not developed I understand that it can be quite a work.

Just asking… tell me if I can help somehow. ^_^

@tyxla
Copy link
Contributor

tyxla commented May 31, 2016

@tschortsch: I believe forcing it wouldn't be a good idea.

@doup: I really like that suggestion. We should implement it 👍

@tyxla
Copy link
Contributor

tyxla commented Jun 9, 2016

The feature has been implemented here: #35.
Props @m1r0.
Documentation coming soon, as well.
@tschortsch, @doup, thanks for the great ideas, folks 👍

@tyxla tyxla closed this as completed Jun 9, 2016
@tyxla
Copy link
Contributor

tyxla commented Jun 9, 2016

Documentation of the new feature has been added: htmlburger/carbon-fields-docs@9c7e525

@doup
Copy link
Contributor Author

doup commented Jun 9, 2016

Wow, thanks! Looks really neat, I'll test it next week in a couple of projects. 👍 👍 👍

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

3 participants