Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Soma

    the-omnia.com

    Thanks guys! Renobird, thanks for the report, just fixed it.
  2. 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.
  3. Soma

    the-omnia.com

    Thanks sinnut for mention it! Already forgot about that I've set a background size...
  4. 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
  5. 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.
  6. 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.
  7. 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; } ...
  8. Ups, almost forgot about them. *hidesinthecorner*
  9. 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.
  10. 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.
  11. 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.
  12. I agree it's almost there. Maybe do some training here http://type.method.ac/ first, then come back...
  13. 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.
  14. in IE it's VML. One would use the excellent raphaëljs library to do it cross-browser. http://raphaeljs.com/
  15. 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.
  16. What versions are you running? I think "fieldgroups_fields.data" was added at some point in 2.2.
  17. I would just make an image.
  18. It's one of the statuses you see in the top of the Pages class. So you can set the status using it like: $page->status = Page::statusUnpublished; Edit: Have you looked on the Cheatsheet? For reference under "Page Status" http://processwire.com/api/cheatsheet/ BTW aren't you the guy with the processwiresexy, whatever? I'm kinda surprised you didn't know this.
  19. try to form them like this. (should be outputed like this) <p>https://www.youtube.com/watch?v=pbDn_Np3Pfw</p> <p>https://www.youtube.com/watch?v=pbDn_Np3Pfw&feature=player_embedded</p> then use this script I use on a site: if(strpos($page->body, '<p>https://www.youtube.com') !== false) { $replacement = '<iframe width="444" height="280" src="https://www.youtube.com/embed/$1?$2" frameborder="0" allowfullscreen></iframe>'; $page->body = preg_replace('#<p>\s*https://www.youtube.com/watch\?v=([^\s&<]+)([\&amp\;+?].+).*?</p>#iu', $replacement, $page->body); } $ with this you can add more than one url params to configure YT player. For example &autoplay=true or something like that etc...
  20. actually both of those are malformed. the second one looks like it also has double encoded & turned to & then turned to & ...
  21. Actually I think it would be a welcome feature. I believe it should be in the core by default, at least to make the html title unique to different installations using a domain name in the html title of the admin. Because if you bookmark login to PW sites or in the history it currently just titles them "Login - ProcessWire". No chance to know what installation it is. It could be a config value in the config file, as mentioned. Nice idea diogo. I will implement that into my teflon theme right now.
  22. Hey cool, and what did you do? jk
  23. Ok now.... I almost was going to jump! Grrrr I thought that something is weird all the time. The problem was that I used a image field that was skrewed, because at some point I changed the inputfield use "crop image", but the fieldtype was still "image" and not "cropimage". That made all the testing,coding a little difficult, unexpected behavior etc. Oh dear. Edit: I just tested again and removed unessesary code. Will just commit the update to github.
  24. Hmm, so this wouldn't be a good idea to use it for transfering a site? I mean if the site has perimissions and roles, users setup (also on templates) this information wil get lost?
×
×
  • Create New...