Most of CSS related URLs will be images (e.g. a button, icon or background). We might as well help the developer to take care of the validation for that:

  • URL syntax
  • does it exist?
  • is it an image?

Offer a form API element 'style_settings_image_url'.

Comments

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new13.98 KB

Attached patch offer a new form API element '#type' => 'style_settings_imgurl' that:
- accepts an absolute or relative (from base) URL
- if not empty, validates the URL syntax, if it is an image and exists (no 404).

lolandese’s picture

StatusFileSize
new13.93 KB

As above plus corrections of the provided code example that has been tested.

  • lolandese committed 1f4ae78 on 7.x-1.x
    Issue #2533666: Offer an image URL form API element for developers
    
lolandese’s picture

Status: Needs review » Fixed
StatusFileSize
new15.52 KB

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.