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

Widget action not shown when not set in the fieldset #2147

Closed
AndreasSchantl opened this Issue Aug 30, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@AndreasSchantl

AndreasSchantl commented Aug 30, 2018

Description
If a fieldset has not set the optional title, a blank button will be shown in the widget.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Fieldsets'
  2. Create a fieldset or edit an existing one to not have the optional title
  3. Create a collection with this fieldset
  4. Create a widget in the CP for the collection
  5. See a blank blue button in the top right corner

Expected behavior
If no title is specified, the text inside the button should fall back to a "+"-icon or "Add".

Screenshots
Widget of collection - see the blank button
image

Further steps
Link the widget section to the fieldset section to make clear that the optional title will be shown as an action in the widget. Maybe even consider to make the action text configurable within the widget.

Environment details (please complete the following information):

  • Statamic 2.10.4
  • Fresh Install or Upgrade: Doesn't matter
  • OS: Windows 10/CentOS7 (Server)
  • Browser: Chrome
  • Web Server: Apache
  • PHP Version: 7.2

@jackmcdade jackmcdade self-assigned this Oct 29, 2018

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Oct 29, 2018

I can't recreate this at all. The way the logic works is it'll take (in order):

  1. The create_title value of the fieldset
  2. Else the title of the fieldset
  3. Else the slug of the fieldset.

At the very least it should be say something like New Blog or something.

Is your site in English?

@AndreasSchantl

This comment has been minimized.

AndreasSchantl commented Oct 29, 2018

image

If I leave it blank, it still shows a blank blue button. My site is in German, but I tried setting my users CP language to English for testing - without luck.

This is still true for Statamic Version 2.10.7

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Oct 29, 2018

Literally can't recreate it no matter what I do. Can you share your site perhaps?

@AndreasSchantl

This comment has been minimized.

AndreasSchantl commented Oct 29, 2018

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Oct 29, 2018

@AndreasSchantl

This comment has been minimized.

AndreasSchantl commented Oct 29, 2018

Done!

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Oct 31, 2018

Remove create_title: '' from the fieldset. That fixes the blank button.

A blank string shouldn't be getting saved though, we'll sort that out.

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