Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. I always use a text field to copy in video url or code. If needed inside a text I use a tag that will be replaced.
  2. Thanks Pete. But that's not really a solution I like
  3. Interesting fact is that after building couple sites, some with lots of images, there's been always a good solutions (image per page) that even without a media manager it just works. The on page files has limits it seems at first, but it has also many pros. People working with me or clients wheren't really asking for something, but saying this is amazingly simple. Drag upload all files, arrange them and the gallery is finished. I find it fascinating that you can actually do pretty much with that system and even without a "real" media manager all the other cms have, which I mostly found akward to use.
  4. Yeah I know, you can change it in the settings. I also thought the same but couldn't decide what would be best.
  5. Thanks all! Little update for 0.0.6 - added View Page to the list "ctrl+v". - Also, I was thinking about adding a shortcut to the Template and Field pages. I figured simplest is to add a link in the label in front of the searchfield. If you open the dialog, you can now simply press "shift+tab" to focus on that link and hit enter. Edit: lol, just figured that "shift+tab" doesn't seem to work in FF. Back to the drawingboard ¨ Edit2: Ok this seem related to OS setting in MacOSX. If in FF make sure this in enabled http://support.mozil...enus or buttons
  6. Just made a little test and changed code to add setOutputFormatting to false. This is required to get it to work.
  7. I think it's easy if you see the repeaters as pages array Out of my head this can be done like this: $elements = $page->repeater->find("checkboxfield=1");
  8. How about foreach($u->execute() as $filename) { $img = $page->images->add($filename); $img->description = "what you want to say about the image"; } Edit: guess not. But it should also be possible to create a pagefile and add description before adding. $page->setOutputFormatting(false); // or $page->of(false); foreach($u->execute() as $filename) { $img = new Pageimage($page->images, $filename); $img->description = "what you want"; $page->images->add($img); } $page->save(); $page->setOutputFormatting(true); // or $page->of(true); Not tested but should work. I'm sure Ryan will come up with something else. But the solution you found is totally valid and also nice.
  9. Not sure what exactly you need. Those numbers with the "next" looks like a pager? Is that coming from where? The $types->render() causes it? However this is not what you need, you just have to foreach the types and output them any way you like. $types = new PageArray(); foreach($products as $product) { // get the types selected, assuming your page field is "catalog_product_type" // add() will import a set of page array or a single as of latest PW, if older PW you can // use import() method to import arrays $types->add($product->catalog_product_type); } echo "<ul>"; foreach($types->sort('title') as $type) { echo "<li>$type->title, $type->url, $type->id</li>"; } echo "</ul>";
  10. Marty the machine! Like it
  11. Added several new actions. Added shortcuts to admin main pages. The most fun is to open a autcomplete search to find and edit templates or fields. Now you can wherever you are press "ctrl+shift+t" or "ctrl+shift+f" and get something like this: Once open you can type and select, hit enter and directly go to edit screen. Enter a char and hit backspace to show all. Have fun.
  12. Thanks Marty, just commited an update that should fix it for FF.
  13. Just made an update to be even more great!
  14. Your welcome. Thanks. Little update after playing around a little. changed to use save hot key for all edit screens to save not only page. added "Add new" hot key support for Template, Fields, Users, anything that has a "Add new" button. Have fun.
  15. ProcessWire2.+ Admin Hot Keys 0.0.7 This modules adds hot keys functionality to PW backend. The keys can be configured in the module settings in the admin. I created a repo here for download and if anyone interested in picking it up. https://github.com/s...ic/AdminHotKeys Currently it supports Save : ctrl+s Add New : ctrl+n View Page : ctrl+v Open Pages search : alt+q (search field can be configured) Open Templates search : ctrl+shift+t Open Fields search : ctrl+shift+f Goto Pages : ctrl+shift+p Goto Setup : ctrl+shift+s Goto Modules : ctrl+shift+m Goto Access : ctrl+shift+a Note: If you're inside a text input it will ignore the hot keys, as to avoid problems with already defined key. Tip: If you open up templates or fields autocomplete search `ctrl+shift+f|t` press `shift+tab` to focus on the link in the label previous to the search input box. Now hit enter to get right to the template or field screen. (If using FF make sure to enable tab focus for all elements in MacOSX: http://support.mozil...enus or buttons)
  16. I just started and created a simple module to add hot keys, currently only starting with Page Save. https://github.com/somatonic/AdminHotKeys
  17. Does it work for you in Safari here: http://html5demos.com/file-api? Safari doesn't support file upload API PW is using, thus the drag upload message isn't showing, it will fall back to traditional method.
  18. I would question the need for a CMS to do this. This either can better and should be done using some setup server side or locally using grunt.js or similar there's many great resources. Edit: Not excluding that there could be a simple module helping setting it up. Not sure if that would make sense though.
  19. There's no HTML for page break, but css has (for printing context) http://www.w3schools.com/cssref/pr_print_pageba.asp
  20. Yes Pete , that's exactly what I did on one site. But I try to avoid this setup.
  21. ProcessWire has the functionality to add scripts and css using $config var. $config->scripts->add(pathto.js) $config->styles->append(pathto.css); Then the output <?php foreach($config->styles->unique() as $file) echo "\n <link type='text/css' href='$file' rel='stylesheet' />"; ?> <?php foreach($config->scripts->unique() as $file) echo "\n <script type='text/javascript' src='$file'></script>"; ?> This way a module could also add script using this. But there's no front-end module that does use it. It's up to the site builder.
  22. I still trying to understand why you need to... Also using repeaters will simplify alot, even you could maybe make it up . Seeing you can't put the script up or don't even try to, I don't think it's a good idea to take an advanced script you don't understand, and it can get complicated... Well I don't want to be mean, something like this should help: $bodyArray = preg_split("/(<h4>.+?<\/h4>)/", $page->body, 0, PREG_SPLIT_DELIM_CAPTURE); // get urlsegment pageNum, pageNum's needs to be turned on on template setting // returns 1 by default even if no urls segments set. $pnr = $input->pageNum; if($pnr == 1) { echo $bodyArray[$pnr-1]; } else { $pnrText = ($pnr-1)*2; $pnrSep = $pnrText - 1; echo $bodyArray[$pnrSep] . $bodyArray[$pnrText]; } // add link list to all text pages splited $count = (count($bodyArray)-1) / 2 + 1; for($i = 1; $i <= $count; $i++) { if($i == 1) { $title = "<h4>First Page</h4>"; } else { $title = $bodyArray[($i-1)*2-1]; } $class = ''; if($i == $pnr) $class = " class='active'"; echo "<a$class href='./page{$i}'>{$title}</a>"; } EDIT: Optimized code a little as the count wasn't right.
  23. If you really really want to do it like this I would consider using repeaters here. It will simplify a lot. Also I don't know if that url segment you're talking about is the best option. I sense it would make more sense form a SEO point to consider something like URL: / articles/lorem-ipsum/2 or URL: /articles/lorem-ipsum/page2 From there, using repeaters would be easy thing to mapp the nth repeater to the 1st urlsegment. If really wanting to use 1 text field with h4 as the separator I would try doing it client side with jquery. Not that it's not possible with php, just think it could make sense to not generate additional url indexes. Though from a marketing standpoint those will love it as it generated more page impressions.
  24. If it's not of an issue to have it set in the init. Just thought I'd ask here since I assumed it should be available and couldn't see why it shouldn't. Thanks Ryan!
  25. Thanks Ryan for the explanation. I have to use init() as to change the $_GET("it") before page load. I have used $this->pages->get(2)->url to get the admin url (which may have changed).
×
×
  • Create New...