Hi Everett, what you want to do, sounds a little bit like my system Xett.
this is an example call:
[!Xett? &project_path=`fewo`&service=`belegplanlong`&canedit_webgroups=`testuser,editoren`&config_path=`config`!]
In short words how it works:
1. looks in the path fewo->belegplanlong->includes to the file getdatas.php
2. the file getdatas.php can have something like that:
$roomsparent=$this->xetconfig['docids']['rooms'];
// Wohnungen suchen
$tablename1 = $modx->getFullTableName('site_content').' sc';
$query="select sc.id as room_ID,sc.pagetitle as room_title";
$query.=" from ".$tablename1;
$query.=" where parent= ".$roomsparent;
$query.= " and description <> 'noroom' ";
$query.= " order by room_title ";
$rows = $this->getevents($query);
$rooms=array();
foreach ($rows as $room)
{ $days=array();
//$room_id=$room['room_ID'];
foreach($cal['days']as $key=>$day){
$day=array_merge($day,$room);
$day['getDatasOnRender']='1';
$days[$key]=$day;
}
$room['innerrows']['day']=$days;
$rooms[]=$room;
}
}
$monthdata['tsmonth']=$timestampfirstday;
$monthdata['innerrows']['rooms']=$rooms;
$monthdata['innerrows']['monthdays']=$cal['days'];
$monthdata['cacheaction']=$cacheaction;
$monthdata['cachename']=$cachename;
$monthdata['cacheoutput']=$cacheoutput;
$outerdata['innerrows']['monthlist']=$monthlist;
$outerdata['innerrows']['month'][]=$monthdata;
$xettdatas = $outerdata;
So here in getdatas.php you create your individual array for Xett to work with.
The outer Template is always xetouterTpl.html here in the path fewo->belegplanlong->includes
then you can have nested inner Templates
If you have something like $xettdatas[’innerrows’][’rooms’] Xett looks for an Template roomsTpl.html
and Xett replaces the placeholders in roomsTpl.html for example
[+xett.row.roomname+],[+xett.row.roomsize+],[+xett.innerrows.events+]
for each datarow of $xettdatas[’innerrows’][’rooms’] takes this output and replaces [+xett.innerrows.rooms+] in xetouterTpl.html with this.
You can get all nested arrays in getdatas.php or you can say
[’day’][’getDatasOnRender’]=’1’ somewhere in the array.
Then Xett looks later for the file dayGetdatas.php and works with this array.
If you have forms in your templates Xett processes this forms in the file onsavedatas.php for saving, mail sending or what else you want to do whith this datas.
In the next version I have included a little cache-class, So I can cache different views of each Template.
For example different month-views of event-calendars and so.
One example you can see here:
http://www.meine-goldschmiede.de/testmodx/index.php?id=1122 and there:
http://www.meine-goldschmiede.de/testmodx/index.php?id=1151
I’m sure there is a lot of work to do and to rewrite, but it is working very well and I use it for very different projects.
Bruno