victorjonsson / Arlima

Article List Manager - Wordpress plugin suitable for online newspapers that's in need of a fully customizable front page
28 stars 16 forks source link

Support for multiple teaser previews in admin #29

Closed chredd closed 9 years ago

chredd commented 10 years ago

For responsive layouts it would be awesome to have two (or more) preview windows for the teaser. One for desktop, and one for mobile. The windows would obviously have different widths (set by the filter?).

victorjonsson commented 10 years ago

Should all previews be displayed at once? That would require a very large screen :) Otherwise we could have a tab-menu in top of the preview window where you could switch between the three views.

Edit: ah there would only be two views... okey that would be manageable....

chredd commented 10 years ago

Two previews should be manageable. Arlima already requires a quite large screen so adding a little bit more (if you want to) should maybe be ok. :)

victorjonsson commented 10 years ago

I agree. Maybe we should use filter arlima_tmpl_width for this? The double preview would become activated if you decide to return an array with two numbers (widths).

add_filter('arlima_tmpl_width', function($width, $list) {
  switch( $list->getSlug() ) {
    case  'main':
      $width = array(498, 310);  // Full width and mobile width
      break;
    case 'sidebar':
      $width = array(240, 150);
      break;
  }
  return $width;
});
chredd commented 10 years ago

That sounds like a really good idea! How hard would it be to add this kind of functionality? 1 days work, 1 weeks work, 1 months work?

victorjonsson commented 10 years ago

Well, for someone that knows Arlima inside-out it might take up towards a day to implement this. Between thumb and index finger :)

chredd commented 10 years ago

Sounds reasonable. I might take a look at it when I have the time. It would be a really sweet feature when building a responsive site, or when using the same Arlima lists for both desktop and mobile.

grzegorzkurtyka commented 9 years ago

Hi Guys. This was implemented as suggested (filter for 'arlima_tmpl_width'). Please see https://github.com/victorjonsson/Arlima/pull/57