Currently, panopoly_admin abuses the title field to put the site base URL in front of the path alias:

$form['path']['alias']['#title'] = '<strong>' . t('Permalink') . ':</strong> ';
$form['path']['alias']['#title'] .= (isset($_SERVER['HTTPS'])) ? 'https://' . $_SERVER['HTTP_HOST'] . '/' : 'http://' . $_SERVER['HTTP_HOST'] . '/';

Instead, it should use the '#field_prefix' key, so the field label can remain semantically the label.

Docs on #field_prefix: https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...

Comments

dsnopek’s picture

Issue summary: View changes
mglaman’s picture

Unfortunately this isn't simply just changing the one line from "['#title'] .=" to ['#field_prefix']. This line of JavaScript ruins the layout.

     var width = $('#node-edit #edit-title').width() - $('#node-edit .form-item-path-alias label').width() - 5;
     $('#node-edit .form-item-path-alias input').css('width', width);

Essentially that needs to get refactored. That's the line of code that makes sure the textfield input is as long as possible.

dsnopek’s picture

Blergh! Ideally, it'd be great to size the field with CSS rather than Javascript. :-/

cornifex’s picture

Status: Active » Needs review
StatusFileSize
new1.98 KB

Here's a patch adding site name as field prefix with updated css and jQuery to work as desired.

lenlamberg’s picture

Status: Needs review » Reviewed & tested by the community

  • dsnopek committed 21caf3e on 7.x-1.x
    Update Panopoly Admin for #2295079 by cornifex | dsnopek: Fixed...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Work, great! Thanks for fixing this, @cornifex, and for testing, @LenLamberg! This has been a pet peeve of mine for a long time. :-) Commited.

Status: Fixed » Closed (fixed)

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