Support AreaWebsiteRegister
Language
 
User Login
Username
Password
 
 Login
Information
Article ID9
Created On4/13/2011
Modified4/17/2011
Share With Others

Pattern

So called "Pattern" is a way of scripting commands which run against your DotNetNuke portal database in order to make bulk changes. It's a way that will be develop in our Easy Management module currently being used in page creation.

Use case

Imagine you are testing some development which need certain number of pages in a specific order and each time you want to test you need to start with a fresh DotNetNuke installation. I now how frustrating it could be while I was developing Menu module.

There also may be cases where you want many similar pages to be added or deleted from the children of a specific tab. Do you really want to go and remove them one by one or run a single script and done?

Script

The script is very simple:

+ means you want to add a page as child of the current location. The default location is root.
- means you want to remove a page available at current location.
\ changes the current location to root.
\page1\page2 changes the current location to page2 which is a child of page1
\page1\pro* changes the current location to page1 and targets every page which is child of page1 and starts with pro
+product adds a page as child of current location/target named product
-%pro% removes every page at current location which has the word pro
space space or blank character means one step into. For example if you want to create a page beneath an already created one.

When adding a page you can set other variables at the same time in the same line separated with ; like this:

+pagename;page title;keywords;description;settings pre-set name

Facts

  • Each command should be entered in one line
  • Commands run line by line
  • Add page commands will not change the location but you can create nested pages using a space
  • Once a command has executed there is no undo
  • Errors and typos will be ignored

Sample

+Products
\Products
+Modules
 +Module1;Module 1;this is module 1
 +Module2;Module 2
 +Module3
+Skins
 +Skin1
 +Skin2
\Products\Mo*
+Demo
+ScreenShots;Screen Shots
+Order