# __file__ is the name of a file located in the Wiki directory. It contains the contents of the page to be generated.
|
# The parameters __p1__ through __p99__ are used to contain text that would be placed on the page. Each and every instance of __%1__ in the __file__ would be replaced by the contents of the parameter.
|
((DataPlugin-MakePage|MakePage)) returns a link to the page created and it’s description like this:
|
-~np~((Page Name ))~np~ - Snow White
|
+~040~(Page Name )~041~ - Snow White |
|
! How Would I Use This Plugin ?
|
-As an example – Lets assume that an Admin needed to create 10 (or 1000) similar pages very quickly. The steps to do this are as follows:
|
-# Create an Example page that looks the way the pages should look.
|
-# Copy the text into a Text file.
|
-# To simplify things – create a spreadsheet to hold the data. The format would look something like this:
|
+As an example – Lets assume that an Admin needed to create 10 (or 1000) similar pages very quickly. |
+To simplify things – lets start by creating a spreadsheet to hold some data. It should look something like this: |
|| | ::a:: | ::b:: | ::c:: | ::d:: | ::e:: | ::f:: | ::g:: | ::h:: | ::i:: | ::j:: | ::k::
|
::1:: | ::pname:: | ::descr:: | ::p1:: | ::p2:: | ::p3:: | ::p4:: | ::p5:: | ::p6:: | ::p7:: | ::p8:: | ::p9::
|
::2:: | Page Name 1 | Snow White | | | | | | | | |
|
::3:: | Page Name 2 | The 3 little pigs | | | | | | | | |
|
-::etc:: | | | | | | | | | | |
|
-||
|
+::etc:: | | | | | | | | | | | || |
+ |
+The remaining steps are as follows: |
+# Create an Example page that looks the way the pages should look. |
+# Copy the source of that page into a Text file. |
# Examine the Example page and identify the text that needs to be replaced. Delete that text in the Text file and replace it with the __%__ character and a number like this: __%1__. Each and every __%1__ in the Text file will be replaced with the contents of the parameter __p1__ in the page created.
|
+# The text removed from the Text file should be placed into the appropriate cell in the spreadsheet. i.e. __%1__ text placed in the cell for the variable __p1__ |
+# Add a formula to a cell in the spreadsheet to the right of the last parameter used. The idea is to add all of the text necessary to make the plugin work – it should look like this: =CONCATENATE("{MakePage pname=’" ,A2,"’ descr=’” ,B2, “’ file=’SomeFile.txt’ p1=’” ,C2, “’}”) |
++ Obviously - the length of the formula is dependant on the number of parameters needed. |
+# When finished – copy the contents of the cell into a new wiki page and try it out. |
+# Repeat the last step until you are satisfied with the results – then expand the spreadsheet to include all of the pages needed – and run the plugin for real. |
|
-This would not be the page that called the plugin in the first place.
|
+NOTE: I used Excel to create this formula – your spreadsheet program may have different syntax. |
|
! Security Issues
|
The major security issue is that the plugin would still exist on the page and viewing that page would activate it – causing it to be ran again.
|
-Internally – this plugin is only visible to the Administrator and will only function when he views a page with the plugin on it. Further – the plugin only functions if the file specified in the file parameter exists in the Wiki directory.
|
-Still – even with all of that – any page using this plugin should be locked.
|
+Internally – this plugin will only create pages when the Administrator views a page with the plugin on it. Further – the plugin only functions if the file specified in the __file__ parameter exists in the Wiki directory. |
+Even with these precautions – any page using this plugin should be locked. |
|