Support ⇒ Explain Please ⇒ Add template used to source code ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexExplain Please

Add template used to source code Reply to topic


I struggle to follow which template I need to edit for each page that's displayed. Is there any way of adding the template called to each page's source code?

(I'd put this in projects request or whatever it is but that appears to be a little dead!)

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


It's not dead, people just don't have new features Smile
Add it and we will make it!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


I've added it, pressed submit but it's not displayed anywhere so not sure if it submitted or not...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I've tried as well and it failed Sad

Will check out what the problem is.
As for now you can add it yourself in /includes/classes/template.php
function display($handle, $include_once = true) { trigger_error('Template loaded: '.$this->files[$handle]);

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial

Last edited by DJ Maze on Mon Jun 02, 2014 5:20 pm; edited 1 time in total


Fantastic, thank you!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


DJ Maze wrote
I've tried as well and it failed Sad

Will check out what the problem is.
As for now you can add it yourself in /includes/classes/template.php
function display($handle, $include_once = true) { trigger_error('Template loaded: '.$this->files[$handle]);


Nice tip. Thank you.

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Wonderful! Thanks, thanks, thanks!!!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Has anyone got this working?

Skip that - I see it's not in the source code it's in the notices. Brilliant, thanks!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Added in v10 debugger

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial

Last edited by DJ Maze on Tue Jun 03, 2014 12:44 pm; edited 1 time in total


Have just tried adding this to the latest version and it gives me a blank page. Did something change?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


What error is in your logs?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Nothing. Empty log.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Could you copy here a snapshot of your modification.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


This works for me on 9.4 - showing whole function for clarity
// Methods for loading and evaluating the templates function display($handle, $include_once = true) { trigger_error('Template loaded: '.$this->files[$handle]); // DJMaze dragonflycms.org/Forum...38/#156338 if ($filename = $this->_tpl_load($handle)) { ($include_once) ? include_once($filename) : include($filename); } else { eval(' ?>'.$this->compiled_code[$handle].'<?php '); } return true; }

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Got it now - I was trying to add a new function as I had forgotten it was simply added to an existing function. Thanks again.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: