Post by Dutch Pride Code » Mon Sep 27, 2021 6:31 pm

I'm looking for a way to display all information pages, with the most recent shown first. Preferably with an option to exclude certain pages. Sort of like a blog main page with pagination, but for information pages only. I do not want to use a blog module for various reasons. The most important reason being that I would have to manage information and blog pages in separate menus. I'd like to keep pages of all kinds in one place, and already got an extension installed for separating information pages by category.

Did anybody by any chance already create an extension for this?
Custom work is not an option, or at least not for now.

OC 3.0.3.2
Default theme

User avatar
Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by straightlight » Mon Sep 27, 2021 11:39 pm

EMGX wrote:
Mon Sep 27, 2021 6:31 pm
I'm looking for a way to display all information pages, with the most recent shown first. Preferably with an option to exclude certain pages. Sort of like a blog main page with pagination, but for information pages only. I do not want to use a blog module for various reasons. The most important reason being that I would have to manage information and blog pages in separate menus. I'd like to keep pages of all kinds in one place, and already got an extension installed for separating information pages by category.

Did anybody by any chance already create an extension for this?
Custom work is not an option, or at least not for now.

OC 3.0.3.2
Default theme
Unidentified extension. Custom work is not an option.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Tue Sep 28, 2021 6:38 pm

EMGX wrote:
Mon Sep 27, 2021 6:31 pm
I'm looking for a way to display all information pages, with the most recent shown first.
They're already ordered by sort_order so just use that to order them by date:

Code: Select all

/catalog/model/catalog/information.php

Code: Select all

public function getInformations() {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC");

		return $query->rows;
	}

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: Semrush [Bot] and 101 guests