Creating New Variable Outside of index.php

Post Reply
andrewinc
Posts: 3
Joined: Fri Aug 07, 2015 2:27 pm

Creating New Variable Outside of index.php

Post 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?
hajo
Posts: 16
Joined: Wed Jan 06, 2016 12:37 pm

Re: Creating New Variable Outside of index.php

Post 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.
Post Reply