Date-based URLs
Permalink
I've checked the forums, chewed some gum, done 1,000 jumping jacks and masturbated twice with each hand though not found a rock-solid way of implementing dates or other numerically unique identifiers in URLs for blog posts, each of which is created on the dashboard and powered by a tricked-out version of Easy News, an add-on block.
I found information on creating date-based URLs with concrete5 here:http://c5cookbook.com/recipes/make_a_blog...
It basically says the task will be difficult to do because of C5's global sitemap.
It doesn't say it's impossible, though.
I think the key to it could be in the controllers.
Here's my tricked-out Easy News' libraries controller, mcnews/libraries/controller.php:
And here's mcnews/libraries/controller.php:
Am I on the right track here?
I found information on creating date-based URLs with concrete5 here:http://c5cookbook.com/recipes/make_a_blog...
It basically says the task will be difficult to do because of C5's global sitemap.
It doesn't say it's impossible, though.
I think the key to it could be in the controllers.
Here's my tricked-out Easy News' libraries controller, mcnews/libraries/controller.php:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class McnewsPackage extends Package { protected $pkgHandle = 'mcnews'; protected $appVersionRequired = '5.5'; protected $pkgVersion = '1.1'; function __construct(){ Loader::library('controller',$this->pkgHandle); Loader::library('dashboardcontroller',$this->pkgHandle); } public function getPackageDescription() { return t('Blog manager'); } public function getPackageName() { return t('News');
Viewing 15 lines of 28 lines. View entire code block.
And here's mcnews/libraries/controller.php:
<?php defined("C5_EXECUTE") or die(_("Access Denied.")); class McnewsController extends Controller { const rssPagePath= 'tools/packages/mcnews/rss'; const pkgHandle = 'mcnews'; public function on_start() { } public static function getPackageUrl(){ $pg = new Package(); $pg = $pg->getByHandle(McnewsController::pkgHandle); $ci = Loader::helper('concrete/urls'); $packageURL = $ci->getPackageURL($pg); return $packageURL;
Viewing 15 lines of 23 lines. View entire code block.
Am I on the right track here?