Jump to content

simonGG

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by simonGG

  1. I startet this project without maken a proper plan befor. A lot of tired night work ... it total mixed atm some pages use dashes some underscore - i will unify this soon. But this pages will not be reacable in the browser via url. Ther a more a kind of container
  2. Sorry this was c&p mistake - i edited the php code... And yes that was the mistake - now i define $targetPage like so: $targetPage = "/color_items_".$target."/"; An everything works fine (banging my head on the table) Tanks a lot adrian!!! Cheers Simon
  3. Hi there, the example i postet was just dummy code to illustrate my problem. Let me explain what's really happening: I have a js function called createColorItem.js define(function () { var scriptURL = cmsURLS.urls.root + 'php/updateColorItem.php', _target = cmsURLS.urls.target, _dropRect, _color; return { create: function (itemData, EventBus) { _dropRect = itemData[0].toString(); _color = itemData[1].toString(); var scriptURL = cmsURLS.urls.root + 'php/createColorItem.php'; $.ajax({ url: scriptURL, type: 'GET', data: { target: _target, dropRect: _dropRect, color: _color }, }).done(function(data) { //.. }); } }; }); As you can see it calls php function updateColorItem.php <?php namespace ProcessWire; require_once '../index.php'; $drop_rect = $_GET["dropRect"]; $item_color = $_GET["color"]; $target = $_GET["target"]; $color_items = wire('pages')->get('/color_items_desktop/')->children(); $newIndex = count($color_items)+1; $p = new Page(); $p->template = 'color_item'; $p->parent = wire('pages')->get('/color_items_desktop/'); $p->title = 'colorItem'.$newIndex; $p->save(); $p->desktop_drop_rect = $drop_rect; // TODO: das muss es auch für tablet und mobile geben $p->color = $item_color; $p->save(); echo $p->id; So this all works fine! But i what i want to achieve is this: $targetPage = "color_items_".$target; $color_items = wire('pages')->get($targetPage)->children(); And this is not working? Look behind the scene (whit the working code) http://devbureau.de/video/ Cheers Simon PS: Yes all GET vars are coming - and i dont sanitize atm - because it's for one singe user/client ... he wont try to kill his system .) PPS: This is a visual grid editor (backend) for the front end First Image is the frontend - secon grid editor
  4. Hi there, can anybody please explain to me why this dosent work? Im really new to php - cheatsheet says: Get the page matching the given selector string... So selector string is not meant to be normal string i guess? Thanks Simon <?php namespace ProcessWire; require_once '../index.php'; $siteVar = $_GET["target"]; $theSiteName = "site-".$siteVar; $p = wire('pages')->get( $theSiteName );
  5. Yes ProDrafts is exactly what im looking for ... The only CMS i worked befor are concrete5 and WP - they both have it by default (c5 anyway is more like wysiwyg). So i hoped .) thanks anyway & cheers Simon
  6. Hi adrian, thanks for the reply - let me ask another question: is there currently anyway/antoher to preview Pages? I mean an module or maybe even build in functions? all the best Simon
  7. Hi there, i just installed the ProcessPreview Module and it works on templates with classic field types like Textarea/Text etc. But if a template uses a repeater - the modul seems to be unable to get the contents. I tried to modify the modul - but im still learning php - so my guess i have to make changes here line 38-39 and maybe add repeater support here line 35 ... Thanks for reading/helping Simon
×
×
  • Create New...