Page 1 of 1

Creating New Variable Outside of index.php

Posted: Fri Aug 07, 2015 4:50 pm
by andrewinc
Hello Wonderers!

I'm looking to add a new variable (or whatever they are called) that does not have to live in index.php. So to create a new variable, the documentation says:

Code: Select all

1. Open index.php and use $c['newarea'] to create a new editable area.
Add the following code around line 20 (for example add it below $c['subside'] - which currently serves for your static sidebar).
$c['newarea'] = "This is a new editable area!";
Source: http://wondercms.com/documentation

That's all fine and well, but I would like to make a new variable that has its own file in the files directory. So, next to home, password, title, etc. there would be my own, insert-able variables.

This would make managing larger pages and project less confusing, at least to me. Is this possible?

Re: Creating New Variable Outside of index.php

Posted: Tue Jan 26, 2016 7:25 am
by hajo
andrewinc wrote: I'm looking to add a new variable (or whatever they are called) that does not have to live in index.php.
.. but I would like to make a new variable that has its own file in the files directory.
So, next to home, password, title, etc.
That is exactly how regular pages are handled - text for page1 goes into file page1.
The code in index.php just sets up some default-texts when such a file doesn't exist yet.

Try this: log in, make page "Page01", fill it with some text,
then download files/page01, and files/menu.

For larger pages: I concur that the built-in editor is not very userfriendly.
But you can download and edit pages offline, using any editor
capable at handling html, and upload them again when finished.