How do I resize the front page banner?
It appears that the banner is heavily integrated so that site changes automatically adjust the height and width of the banner.
However, I would like to use a fixed width for example (960x355). Where do I make the changes to get this done?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrfelton’s picture

Status: Active » Fixed

Hi,

The 'banner' on the homepage is actually an instance of the Spotlight functionality which is provided by Panopoly Widgets. To get it to display full width, just place it into a full width region on your page. It will remain fixed at the full page width, until you resize your browser down to mobile size, at which point it will adjust to fill the full width of the mobile device.

mrfelton’s picture

Alternatively, if you want more control than that for some specific instance of the Spotlight widget then you should probably write a custom Panels style plugin, and adjust the output through that.

Have a read through of https://drupal.org/node/427192 for some ideas. There are some links to tutorials there too, although most are a little out of date.

grkm2002’s picture

The width of the page is not the problem and I understand the purpose which is to have a response theme. However, what I would like to change is the Height of the image. Do I need to edit the image style that the image is uploaded with?

mrfelton’s picture

Well, basically yes. The image style controls the output of the image. But the image styles that the spotlight widget uses are generic styles shared and used by lots of different widgets and components provided by panoply. So if you just edit the image style you will alter the image output not only for this single instance of a spotlight widget but also for many other things. This is why I was suggesting implementing a separate style plugin. So that in this other style plugin you could make that widget output the images using your own image styles using whatever dimensions you like, without affecting other things.

I have not tried this, so tho is just conjecture at this point. Another alternative could be to use one of the field api alter hooks to alter the way that this image field gets output only in this specific instance.

mrfelton’s picture

Status: Fixed » Active

Actually, just looked into this a little. The spotlight widget does use its own image style, but it is shared by all spotlight widget instances. So if you edit the panopoly_image_spotlight image preset (http://academy.local/admin/config/media/image-styles/edit/panopoly_image...) it wouldn't affect other parts of the site - but it would affect all instances of the spotlight widget.

Another option could be to use https://drupal.org/project/formatter_field and https://drupal.org/project/formatter_field_preset you could add a new formatter field to the spotlight widget fieldable panel pane (http://academy.local/admin/structure/fieldable-panels-panes/manage/spotl...) which should then enable you to specify the image preset to be used on the pane settings form, on a per widget basis. That actually might be a nice addition to panopoly_widgets itself.

grkm2002’s picture

I prefer your last suggestion. I will try it out and see how it works. If you can make it an addition to the panopoly_widget itself that would be "perfect" and it would give more control to the webmaster o make subtle changes across your theme.

mrfelton’s picture

Status: Active » Needs review
FileSize
8.4 KB

I tried this at the weekend and it worked really well. Attached is a patch for panopoly_widgets. You'd need to download the formatter_field and formatter_field_preset modules though. Also, this patch uses the panopoly featured image style with the featured formatter preset. It may be better to introduce a new image preset into the panopoly_images module and use that instead.

Whilst this works, I think there may be a better, more lightweight way to implement this in panopoly widgets that doesn't require the addition of 2 modules.

Note, patch against panopoly_widgets 7.x-1.x-dev

Sakhmed’s picture

Issue summary: View changes

Another option could be to use https://drupal.org/project/formatter_field and https://drupal.org/project/formatter_field_preset you could add a new formatter field to the spotlight widget fieldable panel pane (http://academy.local/admin/structure/fieldable-panels-panes/manage/spotl...) which should then enable you to specify the image preset to be used on the pane settings form, on a per widget basis. That actually might be a nice addition to panopoly_widgets itself.

Can you please put together more detailed instruction how to accomplish this? Thanks

roblav’s picture

The steps are:

1. Install and enable these 2 modules:

https://drupal.org/project/formatter_field
https://drupal.org/project/formatter_field_preset

2. Apply the patch

Download the file
https://www.drupal.org/files/2083401-panopoly_widgets-spotlight-style.patch

Move the file into the panopoly widgets directory. You'll find it here /profiles/openacademy/modules/panopoly

Apply the patch using git or patch from the command line.

Find out more about applying patches here https://www.drupal.org/node/620014

(Note: Although I used the OA version 7.x-1.0-beta5, as stated in the issue, I still had a small issue with the patch and had to manually add the bits of the patch that failed.)

3. Choose your own image style

Now if you go here:
http://local.openacademy/admin/structure/fieldable-panels-panes/manage/s...

In the 'Image style' row under the column 'Widget' you should see 'Formatter preset select'
Change this to ''Formatter select' (See attached image)

Now when you edit the field 'Image style' you can choose which image style to use.