2014-06-11, 05:20:25
(2014-06-10, 21:46:55)jeherrin Wrote: The site I'm working on has two basic template files — the main, default template file for the overall site, and a second blog template to deal with and style the blog page. In the interests of making the site responsive and mobile-friendly, my CSS uses media queries to restyle the site depending on the viewer's browsing device.
On the desktop site view, News Manager is set to display full posts, with five posts per page (the client tends to write quite long posts!) but on the mobile view, I'd like it to change to titles and excerpts, rather than showing the full thing. Is there a way to set this in the template rather than in the options? This way, I can use CSS to show/hide content container divs as required — I'll have two content divs, each with the blog, but the second div set to only show excerpts, and set via the CSS to only display on certain screen sizes.
Very interesting.
With News Manager 3.0 ("beta but usable") you can use some of its new functions to do something like this: in your blog template, replace
PHP Code:
<?php get_page_content(); ?>
PHP Code:
<?php if (nm_is_main()) { ?>
<div id="desktop_version">
<?php get_page_content(); ?>
</div>
<div id="mobile_version">
<?php nm_set_option('excerpt',1); nm_show_page(intval(@$_GET[NMPARAMPAGE])); ?>
</div>
<?php } else { get_page_content(); } ?>
(change the id's by the ones you like, or classes if you prefer)