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

FR: {{ focus }} and {{ focus_css }} should default to 50-50 and 50% 50% #1577

Closed
FrittenKeeZ opened this Issue Aug 31, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@FrittenKeeZ
Copy link

FrittenKeeZ commented Aug 31, 2017

Expected behaviour

When using {{ focus_css }} I except it to return '50% 50%', when I haven't set it manually.

Actual behaviour

The tags returns an empty string, resulting in a broken css style "background-position: ;"

Steps to reproduce

  1. Use {{ focus_css }} on an image with no focal point set.
  2. See that the style tag is broken
  3. Install the FocalPoint addon
  4. Use {{ focal_point }} instead
  5. ???
  6. Profit

Server Details

Statamic Version:
2.6.8

Updated from an older Statamic or fresh install:
2.6.6

List of installed addons:
FocalPoint

Bonus

Replace line 104 in Statamic\View\BaseModifiers from return $value; to return '50% 50%';.

@jackmcdade

This comment has been minimized.

Copy link
Member

jackmcdade commented Aug 31, 2017

Good idea. In the mean time you should be able to do {{ focus_css or "50% 50%" }}.

@jasonvarga

This comment has been minimized.

Copy link
Member

jasonvarga commented Aug 31, 2017

If there's no focus value, then it's blank. It's always been that way. We can change it though.

@jasonvarga jasonvarga changed the title Bug: {{ focus_css }} returns empty when no focal point is set FR: {{ focus }} and {{ focus_css }} should default to 50-50 and 50% 50% Aug 31, 2017

@jackmcdade jackmcdade closed this Apr 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.