CoasterCms / coastercms

The repository for Coaster CMS (coastercms.org), a full featured, Laravel based Content Management System
https://www.coastercms.org
GNU General Public License v3.0
392 stars 107 forks source link

Hi can you help me how to show from latest to first in blog archive page, What to change heere ? #72

Open SarajevoNo1 opened 6 years ago

SarajevoNo1 commented 6 years ago

Hi can you help me how to show from latest to first in blog archive page, What to change heere ?

<?php $postDates = explode('-', Request::input('id')); $range = !empty($postDates[1]) ? 'month' : 'year'; $postDates = array_filter($postDates) + [date('Y'), '01']; try { $fromDate = \Carbon\Carbon::createFromFormat('Y-m', implode('-', $postDates))->startOfMonth(); $toDate = clone $fromDate; $toDate->modify('+1 '.$range); $pages = PageBuilder::categoryFilter('post_date', [$fromDate, $toDate], ['view' => PageBuilder::block('category_view'), 'match' => 'in', 'renderIfEmpty' => false]); $archive = ($range == 'year') ? 'Year ' . $fromDate->format('Y') : $fromDate->format('F Y'); } catch (\Exception $e) { $pages = []; $archive = 'None'; } ?>

chadanuk commented 6 years ago

@SarajevoNo1 The ordering can be managed through the admin. As long as you've got a date block on your blog template you can then manage the ordering through the group options in the admin

SarajevoNo1 commented 6 years ago

Where can I find that group options exactly in admin ?!

What s the route to that im admin...

Thanks

Get Outlook for Androidhttps://aka.ms/ghei36


From: Daniel Chadwick notifications@github.com Sent: Wednesday, March 21, 2018 5:58:04 PM To: Web-Feet/coastercms Cc: SarajevoNo1; Mention Subject: Re: [Web-Feet/coastercms] Hi can you help me how to show from latest to first in blog archive page, What to change heere ? (#72)

@SarajevoNo1https://github.com/sarajevono1 The ordering can be managed through the admin. As long as you've got a date block on your blog template you can then manage the ordering through the group options in the admin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Web-Feet/coastercms/issues/72#issuecomment-375017122, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AatkBS_ZoV_5F7DqLnr7h6s4qHUR7OZZks5tgoabgaJpZM4Szrgl.

chadanuk commented 6 years ago

Hi @SarajevoNo1, it depends on your group page set up, click the group list icon screen shot 2018-03-22 at 08 59 29

Then click the 'Edit group Settings' button: screen shot 2018-03-22 at 08 59 36

Then you can set the order based on blocks on the post templates: screen shot 2018-03-22 at 08 59 53

Hope that helps!