Page 1 of 1

Feature Request: look for "default-content.php' in themes

Posted: Sun Jun 15, 2014 5:45 am
by cristoslc
Instead of requiring that new areas' default content be added to the index.php file, it would be very helpful if WonderCMS automatically checked for a "default-content.php" file in the theme's directory, and imported it. Similar to the methodology used in the Jumbotron theme in line 22 at https://github.com/cristoslc/WonderCMS- ... /index.php

Re: Feature Request: look for "default-content.php' in theme

Posted: Fri Jun 20, 2014 8:54 pm
by wiz
I was busy the last couple of days, I'll check your theme first thing tomorrow morning, and this sounds like a great idea, seperating it from the index. I'll reply on this thread tomorrow.

Re: Feature Request: look for "default-content.php' in theme

Posted: Mon Jun 23, 2014 3:16 am
by cristoslc
Do you prefer requests be raised in this forum, or as issues on Github?

Re: Feature Request: look for "default-content.php' in theme

Posted: Mon Jun 23, 2014 4:07 pm
by wiz
All requests / bug / issue reports should go over here (BETA support - with a new topic).

Re: Feature Request: look for "default-content.php' in theme

Posted: Tue Jun 24, 2014 4:26 am
by cristoslc
I found this code to be adequate, around line 66 of index.php in WonderCMS 0.6 BETA

Code: Select all

# Load default content for theme, if any
$themeContent = 'themes/'.$c['themeSelect'].'/default-content.php';
if (file_exists($themeContent)) {
	include ($themeContent);
}

Re: Feature Request: look for "default-content.php' in theme

Posted: Tue Jun 24, 2014 5:23 am
by cristoslc
Correction: didn't realize it at the time, but this caused issues after changing the text. (Content from default-content.php overrode exiting content from files)

Re: Feature Request: look for "default-content.php' in theme

Posted: Thu Jun 26, 2014 9:39 pm
by wiz
Do you think there's any way to incorporate this into the theme(.php) file itself? (Or any other convenient way perhaps?) I mentioned the other day that we're trying to keep it as small as possible (and we even managed to get rid of one extra file - on the version that's on GitHub.

Other than that, very good concept.

Re: Feature Request: look for "default-content.php' in theme

Posted: Thu Jun 26, 2014 9:48 pm
by cristoslc
I tried that, but as currently written, the default content needs to be loaded BEFORE the content from the files is loaded. Any attempts to load it after the files have already loaded just overwrites the displayed content with the defaults (even if the file contents are different).

If there were some easy way to tell which default content should be loaded, and which areas already have content (from files), then I think it would be easier to build into the theme. Suggestions?

(Also, this suggestion would include adding a few lines of code to the index.php, but I'm not suggesting that default content for the core be moved to a separate file; just that the core check any themes to see if they have default content that needs to be loaded.)

Re: Feature Request: look for "default-content.php' in theme

Posted: Thu Jun 26, 2014 10:00 pm
by wiz
I replied on the other topic, maybe the "new file" I mentioned could include features as you're mentioning.

I understand the problem, maybe we will indeed have to move things around, maybe it would be created seperately each time an user creates a page (within /files/folder-pagename/).

Re: Feature Request: look for "default-content.php' in themes

Posted: Mon Aug 08, 2016 10:11 am
by mary
Do you prefer requests be raised in this forum, or as issues on Github?