Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. I can't reproduce this. Works all as it should. But I think you're missing the "setEncodeEntities" setting. $dt = $this->modules->get("MarkupAdminDataTable"); $dt->setEncodeEntities(false); ...
  2. Marc, you can see something interesting here http://processwire.c...e-nav-in-admin/ +Also Ryan still has to answer my question there You can load most modules and output them in your process module. You can use Data Table Markup module or an submit button... $dtable = $this->modules->get("MarkupAdminDataTable"); .... $out = $dtable->render(); Of course you can also output any code you like, or include a framework, a module of your own...
  3. You could easily make something like this with using urlsSegment on templates. $action = $input->urlSegment1; $method = "_$action"; if(function_exists($method)) echo $method(); function _addItem(){ return "Item added"; }; Then you can use something like /mypage/addItem/
  4. slkwrm, I have tried, but can't reproduce here. It always stays as it should when I hit save.
  5. Just tested on my local install. Cloning nested pages with repeater now work. So far nothing get's added or deleted. Thanks Ryan!
  6. Looks like the date class isn't loaded. Make sure you have all classes in /.flourish and not in a subfolder. So should be like /.flourish/fDate.php.
  7. Hey marc, as Ryan already stated, changing this core functionality would require A LOT of changes, additional complexity... The ___path function of pages is certainly hookable and possible to rewrite urls, but then you'll have not resolving urls, and the journey continues. You'll certainly run into problems not being able to pull it off because it can't be done or has side effects. As suggested using mutliple trees is the most slim solution. I'm thinking about this subject a long time, and refused to really ask for such a feature because I knew Ryan's answer already. All projects I did at work are multilingual and I solved it always using multiple trees. It makes a lot of thing easier and you doesn't need to consider "will this work here" and start fighting the system. Also you are flexible as much as possible. What I additionally tend to do, is to use "central" content where it makes sense (properties), that's put outside the language tree and then use urlSegments and the language information, to pull the content and display. Urls set in TinyMCE can also be parsed by a runtime hook after Page::render, you then search for certain url structure and replace it with the one you need. I've also done it with simple sections for a online shop (bag-shop.ch) where the products are outside the language tree and the collection page just renders them and product urls get rewritten using the hook technique described above.
  8. And even for this issue there's a module
  9. There should be a xhr request being made when loading the page. Is it somehow returning an error that's useful?
  10. Hey alan, thanks! Glad you like it.
  11. Soma

    the-omnia.com

    Thanks guys! Renobird, thanks for the report, just fixed it.
  12. Soma

    the-omnia.com

    Thanks Dave for the link! Though I don't like to add even more script for something I can do with 3 lines of css in this case. (background-size:100%) I don't care about older browsers that don't support it, it will just center the image and the image isn't that important anyway.
  13. Soma

    the-omnia.com

    Thanks sinnut for mention it! Already forgot about that I've set a background size...
  14. Soma

    the-omnia.com

    Today one of our (http://update.ch) latest PW project went online. Concept and desgin by partner company (http://p-inc.ch). Relaunch of the website for the design hotel The Omnia in Zermatt Switzerland. http://www.the-omnia.com - CMS: ProcessWire 2.2 - Multilanguage (separate tree) - Responsive Layout - Adaptive Images - Lots of images - Passwort protected Media Image download
  15. Thanks for that link, I didn't know. But not sure what you mean with using it here. This is module is for frontend progressive enhanced search.
  16. Ajax Search 1.1.0 There was a request for a ajax live search. So I went and created a simple module. Added in 1.1.0 * added key support for browsing results with arrow down and up. * added escape key to close results. * added close results on click outside http://modules.proce...es/ajax-search/ From the readme: This module progressively enhances the search form to an ajax live search. It will perform a search like you would use the form normally, and returns the output of the search page. So the search will still work without js enabled. There's some basic styling attached to this module in the "styling-example". You can use it to get started. See readme in there. Setup the search.php So it works almost out of the box with the basic install profile of ProcessWire, you only need make a minor change to the search.php template file to only return the content part (results) on a ajax request. To get the ajax search only return the content, open search.php and change the output on the bottom to this: ... if(!$config->ajax) include("./head.inc"); echo $out; if(!$config->ajax) include("./foot.inc"); Module Settings It comes with some module options to define various settings regarding the search form. Following a list with the defaults. Minium length = 3 min length for starting ajax request Close button text = 'close' close button text ID of searchform = #search_form if you have a different search form id,class ID of input = #search_query if you have a different search input id,class Query name = 'q' this is the default param name as_query_url = '' if left blank the script will take the action of the form Any help testing this module is appreciated. If you have any questions or problems setting this up feel free to ask here. Also feel free to use this as a starting point for your own, or take out the script to implement it differently. It's quite simple and can be adapted really quickly.
  17. Not sure if something like this could be helpful to consider here. I'm using a simple module for page/branch level access on user level. There's a simple page field attached to the user template. This allows to select 1 or more page from the site tree. So a user could have edit access for one page or a whole branch (inherited from 1 parent page) I then have a module that does hook into Page::editable and determine if the user has edit access for that page. The module looks like this: ... public function init() { if($this->user->hasRole("client")) $this->addHookAfter("Page::editable", $this, 'checkpermission'); if($this->user->hasRole("client")) $this->addHookAfter("Page::addable", $this, 'checkpermission'); //if($this->user->hasRole("client")) $this->addHookAfter("Page::viewable", $this, 'checkpermission'); } public function checkpermission(HookEvent $event) { // if it was already determined they don't have access, then abort if(!$event->return) return; $page = $event->object; $parents = $page->parents; // run check for parent pages and allow recursive inherit access foreach($parents as $p){ if($this->user->editablepages->has($p)) $event->return = true; } // then run check on selected single pages if(!$this->user->editablepages->has($page)) $event->return = false; } ...
  18. Ups, almost forgot about them. *hidesinthecorner*
  19. Hey there. The $GLOBALS does work. Maybe you got it wrong something. A variable defined in $GLOBALS is available in the script no matter where. Regarding your question, there is always room to improve. It certainly is ok and does already a lot, and I think you're learning a lot. Good job. But I think there's other ways to archive it much simpler code-wise. I for myself I would use pages for tagging, categories and not a textfield. And maybe use urlSegments for the tag instead of url param. Also I would use the pager module that PW already has to do the pagination. Maybe something that's not my thing is all the \n\ \ ... it's too much for my liking. It's ok to use at places, or completely leave them out. It makes it hard to maintain and busy to read. Just my 2 cents.
  20. Aka two posts above. I also wonder what exactly the case is that would make it need something like this. I know about the issue, but never really had to fight with it. Can you provide examples (test page?), I'm sure it can be avoided somehow without php string replacments.
  21. No, but you could create a module to $this->hookAfter("Page::render", $this, 'myrender'); into the Page::render and do it there. Edit: or use a ob_start() php method to buffer the output and do a callback that does the replacement.
  22. I agree it's almost there. Maybe do some training here http://type.method.ac/ first, then come back...
  23. Plain like this, not of course. But you could convert (http://readysetraphael.com/ or Illustrator) the .svg to SVG text string and load that. Of course the overhead just for a logo would be immense. An image, no need to get fancy with css and scripts.
  24. in IE it's VML. One would use the excellent raphaëljs library to do it cross-browser. http://raphaeljs.com/
  25. I've never used this multi site setup, but I think that's wrong. You don't need a "site" folder inside your "site-something" folder.
×
×
  • Create New...