Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. It's a general miss-conception that children need playful childish design, they're as demanding as adults and don't want to be treated with "dodoo dadaa"
  2. You can just use subfields on page references. For example to get the title it would be something like this: pagefieldname.title
  3. This is a little example to show there's nothing that special with repeaters, just think of them as Pages or a PageArray and this example (extending from Ryan's example here http://processwire.com/talk/topic/2089-create-simple-forms-using-api/?p=32856) might help understand https://gist.github.com/somatonic/5391391
  4. Thanks adrian for the report, turns out the download github link as wrong. Should be fixed now.
  5. Somebody just sent me a microdonation on @flattr. Wow! Try Flattr out if you want to support me and other creators https://t.co/n3W4xAQ3Ab

  6. Just added this module to the modules directory. http://modules.processwire.com/modules/chrome-php-logger/
  7. Ok once again I have beaten myself... after trying to find a reason, nothing worked I thought it just can't be and knew there must be something stupid like $page->template = "home" in the code... and gotcha! I really should be more careful and always use "home" == $page->template Thanks diogo for your time.
  8. Thanks diogo, yeah somehow, I just have a main.php and in there echo $page->template outputs "home" always. It's all very confusing and I can try what I want but no success. It works in other installs though. I copied this site from one that is very similar and used same template approach. So as a start I copied db and site folder, and dropped in lates wire core. I'm still trying find what's wrong, but I'm kinda lost.
  9. I use alternative filename on template to use main.php, from where I render the content according to the template name. So basic-page would result in including the /views/basic-page.inc in the main.php I now use latest PW on this new site and it doesn't work anymore, as all those end up having a template name "home". When I echo the $page->template it shows "home" no matter what template. I changed things around and when I use it without alternative filename it works as usual. Can somebody confirm this?
  10. Thanks for you work here mindplay, I'm sure this will be interesting and comes handy for people that use and like this stuff. Personally I never felt the need for this in ProcessWire, as for the hand full of objects and variables I usually need that are always the same anyway. So in other words PW is so simple this is like having a description how to use a key on a door.
  11. How about storing it on a page you put somewhere? I dont think it possible to use module config without using the interface. Otherwise you could maybe store it manually to db on the module using json encode and sql.
  12. Theres a plugin in TinyMCE called CodeMagic. Its not enabled by default but you cab add codemagic to the plugin and controls in the field tinymce settings.
  13. Aah, wasn't reading careful and didn't spot the ...->fields... well yes it's the same at the end but using $fields->product_price->label; is little shorter
  14. Field label is not in the page field value, you have to get it through the field itself. echo $fields->get("body")->label;
  15. If you had a page field with allowing multiple pages (PageArray) and changed it to allow single page later, there could be multiple still saved to the field but you only see one. Try changing it back to multiple pages and check if there isn't more than 1 selected in those on the page.
  16. I haven't used form builder with files upload yet, and I can't find any "file" field in formbuilder 0.2.0, maybe I'm missing something. An php array is accessed array[key] same as in Javascript or other languages. You can get the created like this: foreach($forms->get("contact-form")->entries->find() as $e){ echo "<p>{$e['e_mail']} - {$e['created']}</p>"; } If your 'file' field is itself an array you could try using echo "<pre>"; print_r($e['file']); echo "</pre>"; and you'll see the array printed out recursively and you see all the entries and its keys and values. Once you know the key you access it for example: echo $e['file']['filename'];
  17. $group = $page->widget_group; foreach ($group as $item) { echo $item->widget_group_name.'<br>'; // this works as I see the id# $widget_page = $pages->get($item->widget_group_name).'<br>'; // get the page using the id - doesn't appear to work? echo $widget_page->block.'<br>'; // Shows me nothing - (block is the name of a field on the widget page) } if "widget_group_name" is a page field you don't need to get the page, as you already got it! Though if that page field is set to multiple (PageArray) it would be always an array even if only one page selected in the field. So you'd have to threat it as PageArray and use first to get the first page selected. echo $item->widget_group_name->first->title Or if you change the page field to single page you can use echo $item->widget_group_name->title
  18. Ryan the link on your module http://modules.processwire.com/modules/custom-page-roles/ ... points to this thread as project and support page, but the link has a comment id which might be not here anymore, so it fails loading the thread.
  19. See also this thread with hooks for page access rights: http://processwire.com/talk/topic/371-page-specific-permissions There's a PagePermission.module that has all the permission hooks set for reference you might look in there. All permission hook: $this->addHook('Page::editable', $this, 'editable'); $this->addHook('Page::publishable', $this, 'publishable'); $this->addHook('Page::viewable', $this, 'viewable'); $this->addHook('Page::listable', $this, 'listable'); $this->addHook('Page::deleteable', $this, 'deleteable'); $this->addHook('Page::addable', $this, 'addable'); $this->addHook('Page::moveable', $this, 'moveable'); $this->addHook('Page::sortable', $this, 'sortable'); So most simple and basic delete module would be an autoload module as Wanze mentioned. //... public function init() { $this->addHook('Page::deleteable', $this, 'deleteable'); } public function deleteable(HookEvent $event){ $page = $event->object; if($page->id == 1001) { $event->return = false; } } So if on page with id 1001, there would be no delete function. $event->return should either be false or true and you can do all sorts of checks, for roles, users, permission, shoe sizes...
  20. I'm not sure if repeaters would work as they're somewhat special.
  21. On mobile so short. Yes you have to remove or edit the fields name restriction check in the hook function for the multi select. Line 59 in module. It's hard coded and also other hooks i was experimenting are commented out. Back on laptop https://github.com/somatonic/PageReferenceLink/blob/master/PageReferenceLink.module#L59 ... screw it I just updated it and commented out the check so all InputfieldPageListSelectMultiple fields will have an edit link. This module is just experimental prototype but working and a start.
×
×
  • Create New...