cnb / News_Manager-getsimplecms

A blog/news plugin for GetSimple CMS - development extended version
8 stars 10 forks source link

Post templates / custom post rendering #29

Open cnb opened 11 years ago

cnb commented 11 years ago

full post, short post, recent post, etc.

cnb commented 10 years ago

add custom setting to switch to custom post layout (overriding built-in default):

create php functions to display/return the current post data (à la WordPress' The Loop)

optional: use some placeholders ({{title}}, etc.)?

cnb commented 8 years ago

morvy's suggestion: http://get-simple.info/forums/showthread.php?tid=7332&pid=53811#pid53811

  • give option to override functions responsible for printing output (like in wordpress, if custom function exists, skip default function) or
  • give option to define custom function in settings, something like "main function nm_list_post_custom"
cnb commented 8 years ago

if custom functions were placed in the theme's functions.php file, it would work with GS <= 3.3, but not for the future 3.4, because the file will since then be included after the index-pretemplate hook (GS feature 539). So I think we'll need a new theme file to be included by NM (e.g. nm.inc.php, news_manager.inc.php, nm-functions.inc.php, or perhaps news_manager/functions.php ...)

cnb commented 6 years ago

38f64b7a689a123359ceee6ac23c7b7c10594b48

Custom settings

Functions

Normal display functions

Their output depends on normal and custom settings (e.g.titleLink, classPostTitleLink, DATE_FORMAT, more, etc.)

Conditional functions

They return true or false and can be used, for example, in if (...) { ... } sentences.

Raw display functions

They just output field values, independently of settings

Return functions

They return raw field values that can be assigned to variables or whatever. If echoed, should be done be done with htmlspecialchars

cnb commented 6 years ago

fd47045172d875ea0eedd20963b4ad484a781002

Translation helper functions