Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/22/2013 in all areas

  1. Coming soon: Pages2Pdf module
    4 points
  2. I'm working on update of this theme to 2.0. There's so many tweaks and changes, little detail fixed that I can't list them all anymore. Mainly it is to remove some noise and make it more clean. Maybe I'm going insane, but after working on it so long and back and forth I'm not even sure anymore this all is really an improvement to the previous (which is still nice). But I just don't know what to do now. - Biggest change is I added new font from google font. - Removed all rounded corners - Changed some colors of buttons - Removed headers and some shadows and some lines - Tweaked file upload button with ui button and input - Added css for fieldset columns that will hide it's header label and give nice content, sidebar columns: You can create them using FieldSetOpen field and use some of those names: fieldset_content fieldset_sidebar or column(n) 1-6 - Tweaked page tree to show actions by hovering the page - Removed page tree icons added by the theme. You now can use the excellent TemplateDecorator module by mindplay.dk to add icons per template. https://github.com/mindplay-dk/TemplateDecorator. It required latest PW dev version and php 5.3. If you need a legacy version, you can ask me as I created one for myself. This version requires latest PW dev. I created a dev branch so you can try and test. So far I only tested Chrome, FF and Safari. So if there's any IE8+ users, maybe there's something not working. Maybe I forgot something, but thats it. Here some screens. Download dev: https://github.com/somatonic/teflon-admin-theme-pw2/tree/dev Thanks.
    3 points
  3. I was looking for jQuery Carousel and I stumble upon this cool jQuery Carousel call Roundabout. It has lots of options! http://fredhq.com/projects/roundabout Found from this article: http://www.tripwiremagazine.com/2012/12/jquery-carousel.html
    2 points
  4. Since I know Pw my average sleep time's getting shorter and shorter. Yesterday I went to bed @ 23.00, thinking around Pw-Projects and ideas till midnight and finally realized I couldn't sleep – standing up again to do some coding on a new module till 01.30.
    2 points
  5. Create a field "counter" with type "integer" and set it as "hidden, not shown in the editor" or "always collapsed, requiring a click to open", as you prefer. Put this code on your template: $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); echo $page->counter; voilá
    2 points
  6. Here you'll find it for sure http://copypastecharacter.com/ I always use this site
    2 points
  7. thanks, for pointing out the difference between the two systems. I have a better understanding now of how PW works. For me its way more important to make custom websites, have the freedom to design anything I want and have a clean code, than selling themes. So PW is obvious the better choice for me. Cant wait to start working with PW now
    2 points
  8. Want to share a song we listen every day while programming.
    1 point
  9. Hi Folks, today we will learn how to set up a simple jquery plugin called calendario and fill events trough our admin backend. || ATTENTION || Modern Browser needed First of all, we need the jquery plugin. Grab your copy here: http://tympanus.net/...alendar-plugin/ Now create a new template file, lets call the file calendar.php In the next step we have to include all the needed files from the .zip package. You need the following .css files: calendar.css custom_2.css demo.css Just include them in the <head> </head> of your template file. Feel free to merge them together, so you could save some http connects. Now we need to include the needed javascript. Make sure you have included the latest jQuery library. Include the jquery.calendario.js and the modernizr.custom.63321.js right into the bottom of your template file. Save the calendar.php Now we will set up Processwire where the magic wil happen. We just need one new template. Create a new template called calendar. Assign the field headline to our template. Allow children to just use this template. Hit the save button. Now create a new Page as child of home and call it Calendar. Assign our calendar template to this page. Almost ready. Now we have to do some little scripting in our template file calendar.php Add this html markup to our calendar.php <div class="custom-calendar-wrap"> <div id="custom-inner" class="custom-inner"> <div class="custom-header clearfix"> <nav> <span id="custom-prev" class="custom-prev"></span> <span id="custom-next" class="custom-next"></span> </nav> <h2 id="custom-month" class="custom-month"></h2> <h3 id="custom-year" class="custom-year"></h3> </div> <div id="calendar" class="fc-calendar-container"></div> </div> </div> Now we have to call the javascript function, to get the calendar running. Just put this snippet right under the included jquery.calendario.js <script type="text/javascript" $(function() { var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionend', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionend', 'msTransition' : 'MSTransitionend', 'transition' : 'transitionend' }, transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ], $wrapper = $( '#custom-inner' ), $calendar = $( '#calendar' ), cal = $calendar.calendario( { onDayClick : function( $el, $contentEl, dateProperties ) { if( $contentEl.length > 0 ) { showEvents( $contentEl, dateProperties ); } }, caldata : { <?= getEvents(); ?> // this is our function to grab our events }, displayWeekAbbr : false } ), $month = $( '#custom-month' ).html( cal.getMonthName() ), $year = $( '#custom-year' ).html( cal.getYear() ); $( '#custom-next' ).on( 'click', function() { cal.gotoNextMonth( updateMonthYear ); } ); $( '#custom-today' ).on( 'click', function() { cal.gotoNow( updateMonthYear ); } ); $( '#custom-prev' ).on( 'click', function() { cal.gotoPreviousMonth( updateMonthYear ); } ); function updateMonthYear() { $month.html( cal.getMonthName() ); $year.html( cal.getYear() ); } // just an example.. function showEvents( $contentEl, dateProperties ) { hideEvents(); var $events = $( '<div id="custom-content-reveal" class="custom-content-reveal"><h4>Termine am ' + dateProperties.day + '. ' + dateProperties.monthname + ' ' + dateProperties.year + '</h4></div>' ), $close = $( '<span class="custom-content-close"></span>' ).on( 'click', hideEvents ); $events.append( $contentEl.html() , $close ).insertAfter( $wrapper ); setTimeout( function() { $events.css( 'top', '0%' ); }, 25 ); } function hideEvents() { var $events = $( '#custom-content-reveal' ); if( $events.length > 0 ) { $events.css( 'top', '100%' ); Modernizr.csstransitions ? $events.on( transEndEventName, function() { $( this ).remove(); } ) : $events.remove(); } } }); </script> We are almost finished, but we are missing some very essential, have a look to our javascript. We are calling a function named getEvents() This function will grab our events and fire it right to our calendar. So here is the code: function getEvents() { $events = wire('pages')->get("/calendar/")->children(); foreach ($events as $event) { echo "'$event->title' : '<span>$event->headline</span> ',"; } } Put this snippet above the javascript includes. We will now create our first entry. Go back to the PW admin backend and create a Child of Calendar. Title and name need the Date on which the event has to be displayed. You have to form a date in this format: mm-dd-yyyy e.g. 12-27-2012. The headline field is our Event description. Hit the save button, go to your site and enjoy your event calendar. With a little coding you could extend the calendar to let it look like mine attached as screenshot. Hope this was useful to somebody. Cheerio.
    1 point
  10. Hi folks I thought I'd post up a quick, basic tutorial of how to get started with Github and not have to learn any of the command line code. It's still recommended that you learn the basic commands, but this is aimed to help Git newbies like me get their modules on Github with the minimum effort possible. Check out the PDF below and have fun GitHub for Windows.pdf
    1 point
  11. I love to listen to this while programming http://grooveshark.com/#!/album/Little+Joy/2892128 (for the Germans: https://chrome.google.com/webstore/detail/scilors-groovesharktm-unl/feegenemlbjkbnfpgdmjddbeiecdbpob?hl=en-US&utm_source=chrome-ntp-launcher) Edit: meanwhile I listened to the songs you posted. They are great, but don't think I could focus on programming with them edit2: right now this is what I'm listening to http://grooveshark.com/#!/album/Not+Music/5149661
    1 point
  12. Glad it works now for you also! How can you miss it while it was never there?
    1 point
  13. Thanks Soma, I used the correct link but then I downloaded the files by pointing my git client at the 'Git Read-Only' URL field, which is the same for dev and master, so I've learnt something there Will re-download with the ZIP button, thanks! Edit: All good now. I like this theme a lot. All I miss (as if it's up to you to fix my cravings ) is the 'Recently edited' panel - perhaps if that floated under the uber-useful fixed-pos' 'Save' button..? [please ignore my requests unless you actually want to do them yourself anyway]
    1 point
  14. That was never meant to be used on the front end. I'm impressed you actually got it to work. That module really does need to bind itself to page-edit permission just for the security of the admin. But what you might want to do is copy that modules files to your own dir in /site/modules/ and rename them, and rename the class to something like ProcessPageEditImageSelectCustom. From there, you can modify it to do what you need.
    1 point
  15. Hi Philipp, You can do this Check out the module config options of "InputfieldPageName" - you can actually edit the replacments there.
    1 point
  16. Oh, you are so right! Just need to try and get some cash for all these hours!
    1 point
  17. Doh! ... I knew that! Thanks, Wanze More sleep needed!
    1 point
  18. if (count($page->Files)) { //... } Because $page->Files is a WireArray and that is casted to "true" by PHP
    1 point
  19. Strangely, I am just doing that. I am moving a site from Joomla to ProcessWire and have been doing it basically by copying and pasting the elements. Mind you, it is REALLY easy to lose your place, when you are trying to throw out all the Joomla bits in the process. It may have been quicker just to rewrite the bloody thing!
    1 point
  20. $f = new Field(); $f->type = $this->modules->get("FieldtypePage"); $f->name = 'mypageselect'; $f->label = 'Select Page'; $f->derefAsPage = FieldtypePage::derefAsPageOrNullPage; $f->inputfield = 'InputfieldPageListSelect'; $f->save(); or $f->derefAsPage = FieldtypePage::derefAsPageArray; $f->inputfield = 'InputfieldAsmSelect'; etc
    1 point
  21. Hehe, no magic here. Maybe you have a magic computer?
    1 point
  22. O'Reilly is having a pretty good e-book sale on PHP books: http://shop.oreilly.com/category/deals/php-owo.do?code=WKPHP
    1 point
  23. Bought it as well and tested the speed of the delivery of pages through sitebeam.net and all pages now under 0.1 s which is a 10 in their book, so kudos to ryan! Here's a quote from sitebeam.net about what they mean with response time: ====================quote==================================== The response time is usually a measure of the application powering the website (e.g. a Content Management System or webserver) and the power of any servers running that application. Good application performance means webpages feel responsive to users, and the server is more likely to handle higher volumes of traffic. Poor performance will dissuade users and search engines from the site. ==========================end of quote sitebeam================= And the highest score possible is 0.1 sec and that is what all my pages were doing.
    1 point
  24. Bought. Got a reasonably big site (for me at least) I want to run this on. edit: This site has it running on most of the templates. It was reasonably snappy before. Now it's lightening quick. Cheers Marty
    1 point
  25. You get this kind of itch. It normally starts just at the back of the legs where you have been leaning way to far forward on you chair and are creasing up the fat layers where there really shouldn't be fat layers. Your toes, which by this stage are pointing backward towards the rest of the world, are getting cramped from being hooked round the bar of the chair in nervous expectation. In an attempt to pick up from where you last left reality, you shoot your legs forward, push your clasped hands in the air, arch your back and lean backwards. And it is in those few seconds of frozen time when, just a little too late, you remember you are sitting on a stool and crash in a reverse double flip that would make Tom Daley envious, into what is left of your life. "I'm fine!" You say rather too quickly, with the note of desperation from one who has a sneaking suspicion no one was listening anyway. It is time to scrape your eyes off your ultra-luminescent, super-flat, fake-sapphire encrusted, Rolls-Royce screen and find something more interesting to stare at. I have various illuminating buttons on my desktop. Not that they light up, but I have a whimsy that they may take me to a place that is more enlightening than whichever place I think I currently am; long experience has taught me the folly of believing with my own eyes for that is the fate of the unwary conspiracy theorist. BBC News. No, I already play politics on an assortment of blogs, many of which have gotten me into trouble; I do not feel the need of a top up. Lagoonia. Lagoonia? There is something about Google Chrome that encourages you to collect buttons that you have little interest in pressing. Wurm Online. Nope. When you compose music for something, it is always best to leave them to their own devices. It was the original home of Notch. I wonder if he misses it? ProcessSomething. Ah, that thing. Let’s go there! For some reason, the forums at ProcessWire appear to be a frequent destination at the moment. Apart from a place where kind people unstick me when I need unsticking, it is a place that I can be old in and no one gives a toss. Ah, another person who thinks ProcessWire would be better if it were Wordpress. I used to think that about various things. Luckily for the residents of ProcessWire-Ville, that idea wore off before I got here. I eventually kicked the ambition to death in the Joomla UI forums when I realised no one cared anyway. Anyway, lets give him an essay to ponder over. Ummm ….. flexible …. No theming system needed … easier than you think … I think I am beginning to repeat myself because I keep saying this sort of stuff. But then Soma keeps trying to teach me the same lesson over and over again, with only the vaguest inkling of success (I will get there, mate! I promise), so I am sure I am allowed my little mantra too. Okay, press send and do some more work. I have converted myself to Sublime Text of recent. God knows why, to be honest. In many ways it is little different to half a dozen other programmes I have kicking around on my PC. Prettier though, and of course uber trendy! (how does one type an umlaut?) Just to enhance the prettiness, I have downloaded a Dreamweaver theme for it from somewhere and made the background a fetching off white. Around 13 years ago I spent a whole year sitting next to a guru of a programmer who could write Perl slightly quicker than I am writing this. He was in love with systems like Emacs and Vim and always went for the Laura Croft White on Black colour scheming. He was a giant of a man who made me look thin. Anyway, he took an early version of PhpNuke and turned it into something not far off what Drumlapress is now. The Nuke designers had spent 6 months trying to integrate a forum. He did it in a morning. In one week he found over 600 security holes (every one of which was then ignored by the then designers). Anyway, I digress. It was coding hell – if you could have something called “Deep Coding,” this was it. It out Matrixed the Matrix, long before that tortuous trilogy was born. It was dark, foreboding, gruelling and scarily efficient. I once asked him for a shell script to run cron backups on a machine for 8 different databases, staggered and then farmed out to two external safe machines. The script came back before I had hit send on the email. I installed it and 10 years later it is still running. I swore to myself that I would never look at a black screen again unless it meant it was switched off. If I ever learned to code it would be bathed in warm sunlight on a tropical island of an office and washed over by peaceful waves of colour matched screen harmony. So when Dreamweaver introduced pinks and blues and greens to their colour schemes I was over the moon and have used them ever since on just about anything. The trouble is, I think I am turning into a soft version of that king of the slashdot hackers (he still thinks GW Bush is secretly running the US and Obama is a remote controlled android front). I have discovered that I am spending huge amounts of time getting the spacing in my code “just right,” and the indents subtly mirrored. I even sit back and examine my comments for purity, judge them for content and consider entering them for the Booker prize. But I knew it was time to take a break when in a final attempt to reconcile the world of coding to my genteel British background, my brain had gone south and secretly replace all the $ signs in my script with Pound signs. Mind you, they are worth more than dollars… perhaps I should hit run and see what happens….
    1 point
  26. You need to read up about Repeater fields. Basically, they allow you to group fields together - so for your external URLs, you can have the URL, friendly title, description, image, review - whatever you need. And then repeat that little collection as much as you like. You need to actually install the repeater field - it comes with the installation but is not installed by default. http://modules.processwire.com/modules/fieldtype-repeater/
    1 point
  27. Hi, if it could be of interest at some point for the however named 'Deutsche Seite': I've found a german translation of the GNU v.2 which is meant as an explanation to people not very familiar with english language, but not as a replacement of the original licence. http://www.medien-kooperative.de/bibliothek_gnu_gpl_2_deutsch.html
    1 point
  28. got a spare ö laying around, fell free to use it
    1 point
  29. I like that he hasn't even specified valid code, just gobbledygook code - surely this means you can just mash your keyboard for a few hours and pass it over?
    1 point
  30. So why am I posting a profile in the pub? Well, it is currently so drunken that this is where is belongs. Also, it is a long way off being finished.... Sooooo The Bootwire Blog (of course) is a bootstrap / processwire blog profile that I have started from scratch, more as a learning exersise as anything. And it has certainly given Soma a good work out so far! It is sort of gone a bit beyond a blog, to be honest, and is rapidly turning into a magazine site. It has some interesting features: Categories Topics Tags Post types Authors Choose side bar items globally, or for all category pages, or for all topic pages Choose side bar items (widgets) for any single post Choose themes for posts Posts can have simple galleries added Choose themes for the site (very limited themes to be honest) Centrally control things like headers/footers, number of recent posts to list, lost of other things Posts can be featured on the front page and/or on their own category. Lots of other things. My basic premise that I started from is: 1. Everything is a post 2. Every post belongs to one category 3. Every post can belong to multiple topics 4. Every post can have multiple tags 5. Posts types are based on different templates 6. Themes can be applied to any template 7. Post are also listed by template type. Post types will include: Standard Blog Video Blog Reviews Recipes Photo Blog and so on. The way the categorisation works is quite complicated. But dont worry - here is a huge piece about it! The blog uses five sets of criteria to organise information: Categories Tags Topics Post Types Authors CategoriesThese are the most obvious form of organisation as they make up the main menu hierarchy. On this particular "hover" menu, all categories can accept posts. However, the click-to-open menu version cannot have posts associated with the top level since the top levels will no longer link anywhere. Consequently, it is difficult to switch from one version of the site to another without causing a lot of headaches! Generally it is best to organise the categories into obvious trees: Politics, Sport, Media and so on. Each category can have more than one child creating multiple branches from one top level category. However, making this too complicated or the categories too many layered could be problematical. (note, if this is for touch devises such as phones, too many levels will make it frustrating to navigate. TagsTags are very much what you would expect - single keywords or short phrases that can be associated with posts on a many-to-many basis. Clicking on a keyword creates a seach of keywords on the database.. There is no limit to the amount of keywords that can be created, but it makes sense to re-use keywords as much as possible! TopicsThis is a departure from the normal way a blog or news site works. Topics are broad subject areas that might be related to one particular category, but can be used by any post in any category. For instance, a topic might be created that explores the politics surrounding what we eat. That topic would be of possible use in both the Politics category and the Food category, depending on the post. Topics are far more detailed than tags, but they are limited in number. Unlike tags, they cannot be created on the fly, but are created centrally by the site editors to reflect the nature of the site. A post can be associated with more than one topic, though this may be unusual. Topics will often have long titles and could have long descriptions. A post can optionally display the full topic details in the side bar. Post TypePosts are separated into templates. The most common template is the standard blog which is similar to a Blogger or Wordpress blog. However, further templates are available for perhaps a photo blog featuring a single blog, a full blown gallery blog, a video blog, a review blog, a recipe blog and so on. These Post Types have different layouts and fields that suit their particular subject matter and bring the subject of the post to the forefront. Posts can be sorted by post type. AuthorsObviously, posts have authors. And posts can also be sorted by their author! Well, that is about it at the moment. I have got as far as getting the standard posts, the categories the widget system and the tag system working together with search. I am starting on topics (which I need to think carefully about - not from the tech view, but from the librarian point of view) and will then wonder onto comments. I am going to try and put both the normal system of comments on, but allow for disqus to be used instead. It currently looks like the following (sorry, it hasn't got enough posts in yet, so it is full of holes!) More to come over the next week or so. Joss
    1 point
  31. Yes, well, sharing a house with an overly photogenic Westie means I have plenty of material - so might as well use it. Also, as an occasional political writer, I find little difference between the yelping of a small dog and many MPs.... http://www.pebblesthepuppy.co.uk
    1 point
  32. onjegolders: I feel your pain. But there are lot's of skills in web development and design that "don't get old" and learning and mastering those are beneficial now and tomorrow: design in general typography color theories coding in general drawing, illustrations usability accessibility relational databases coding patterns regexps you got the idea I used to try learn "all new things" as fast as I could. Now when I have over 6 years experience as a professional (+10 years as a hobby) I am much more skeptical about new and shiny things. Of course there are new things that are clearly beneficial (RWD, NoSQL, CoffeeScript, Mobile Apps, Node.js... list is endless), it doesn't mean that you should learn and use all of those. It also doesn't mean that your years of design/coding experience has vanished or that PHP/MySQL cannot be used in anything anymore, or that all sites should be responsive. Usually best practice is wait a little to see which of the new trends are just trends and which are here to stay for a while and proving to be interesting and beneficial for you to learn. I also recommend to read some basics about the topics that are popping from each corner: when you know what is it, you will stress about it much less: "Ah, so Node.js is basically javascript on server side, and it seems to be great in realtime apps because of some bizarre reason. Good to know, but I think that at this point I don't need to learn how to use Node in my work."
    1 point
  33. Thanks for your feedback on this, Ryan. Your active involvement here on the forums is a major factor in my adoption of PW personally and in my day job.
    1 point
  34. Maybe not related with this case in particular. But yes, he does
    1 point
  35. foreach($templates as $template){ $postsparent = $pages->get('/path/to/parent/'); $cwt = $postparent->children("template=$template->name"); if(count($cwt)){ echo "$template->name: \n"; foreach($cwt as $tp){ echo "\t $tp->name \n"; } } } i think this would list out the child pages of any parent grouped by which template they have. Not tested though, and not too sure if children("template=$template->name") is valid
    1 point
  36. Thanks, Soma and ryan!!!!! These are big help to me. Sorry for not enough detailed questions. (I'm a second English speaker.) And I'm a designer, so there should be a lot of code unfriendly words around. And just started php code. (oh well, took the long way to achieve a goal) It's great to hear that ver2.3 is coming with html5 input field patterns validation. About the unique data type, I'll try what you guys say. Sorry about the related fields. It could be combing one field, calling related field as needed, putting into a field as a group, and so on. But Soma and ryan gave me enough solutions. Thank you so much. About the automatically filling field type questions, it came out of my mind because of my lack of coding experience. It will be great experience to figure out all of these, fun possibility just like ryan said. Thanks again guys. You guys are fantastic.
    1 point
  37. hm ryan you do magic? i can't understand, now works... ; thanks anyway
    1 point
  38. Oh my God, this is frigging awesome! So clever and yet so easy to implement. I can certainly tell the client to visit the FontAwesome website every time they need an icon. I also like the string replacement method for the headings but, out of curiosity, how would I 'tweak' TinyMCE advanced settings to be able to get classes/other stuff on there? Would the client have to write the classes themselves? Thanks, Ryan! Go grab that icon-coffee, I'll join you with an icon-beer, virtually that is!
    1 point
  39. You could go with simple text replacement. Lets say you wanted the icons in the body (though it wouldn't matter what field). You'd just instruct the client to visit this page and select the icon they want. That page shows both the icon and the name. You would have them copy the name and then paste it into their copy, wherever they wanted it to appear. Then in your template code, you'd run $page->body through something like this before outputting it: if(strpos($page->body, 'icon-') !== false) { $page->body = preg_replace('/\b(icon-[-a-z]+)\b', '<i class="$1"></i>', $page->body); } So if the client typed this: They'd get this in the markup (which would display the relevant icons): This would be another case where you could use simple text replacement before output: $page->body = str_replace("<h3>", "<h3 class='someclass'>", $page->body); Though if you needed to support different kinds of h3 tags or classes in that copy, then you'd probably want to use TinyMCE advanced settings to setup the 'styleselect' option. This would also be a good option: just targeting those specific h3's with a CSS selector. I think I'm going to go grab some icon-coffee.
    1 point
  40. I see what you mean. Row quantity really isn't a problem so long as the indexes are good. So I suspect even a single table would scale just fine. But if you still prefer a file-based storage option, using the existing $page->filesManager->path might be a good place to do it, as ProcessWire will maintain one directory per page (i.e. /site/assets/files/[id]/. You wouldn't want the version files to be publicly accessible, so you'd probably want to put them in filenames that PW prevents direct access to (like .php). Either of these seem like good options too. One table per field would be consistent with the way PW stores its fields... though that's for DB-related reasons that wouldn't apply to the case we are talking about. I guess the main benefit of splitting things into separate tables per field or fieldtype would just be to allow the possibility of versioning different data types. But your table with the single mediumtext column still allows for it, because all PW field data stored in the DB can be reduced to an array or JSON string: $data = $field->type->sleepValue($page, $field, $value); // convert to array $json = json_encode($data); // convert to JSON string Once it is stored as a string in the DB, then it's no longer "findable" except by possibly a fulltext index. But it seems like these versions probably would not need to have that search accessibility for storage anyway. I think you've got a lot of good ideas here. Though I'm not sure that you necessarily need anything more than what you've already got, with regards to data storage. From what I can tell, the data doesn't need to be selectable by anything in the data itself... just indexed attributes of the data: page_id, field_id, user_id, date. That combination would always be unique regardless of row quantity. It doesn't seem like you'd ever have to worry about potential for "full table scan" in MySQL. But there may be things I'm not thinking of. I haven't had my morning coffee yet. I do agree that splitting tables by fieldtype or field sounds better… but I don't know if it would ultimately matter. It would be interesting to take a table with 1m rows and a field_id index, and compare that to 10 tables with 100k rows and no field_id index. Assuming just straight selection from the table by page_id (no joins) and date-sorted results, would it make any difference? I have a feeling it would not, but haven't tried. But having it in one table you could select all field versions for a page in 1 query and your date-based maintenance could do its thing in 1 query. From a scalability standpoint, probably the only thing it would need there is just some limit on the number of versions it would load at once [25, 50, 100]? I'm assuming it doesn't load the actual version "text" here (it looked like you were doing that with ajax), but just the attributes. So maybe it would just need some kind of pagination or "older versions" link that loads the next block of [25, 50, or 100]. Either that, or you could just have version 1.0 say "we will store a maximum of 100 versions and no more", which would probably be fine for 99.9% of folks. No pagination worries. I think this is what the 37signals guys would say to do, at least for version 1.0.
    1 point
  41. Just stopping by to say thanks! Great post and great comments. It is indeed very much appreciated!
    1 point
  42. The issues with specifying CSS at the page level (in the editor) are that it crosses a boundary between content and style. Ideally these things remain completely separate to ensure the long term portability of the content. As a best practice, styling is best kept part of the site's development files rather than it's content. It's also a security concern, in that you are allowing someone to inject code into a page. However, if all the editors are trusted and know how to use CSS styles in that manner, then only you can decide if the convenience is worth the tradeoffs. For instance, on your own blog site (or something like that) it might be totally fine and convenient. But on something bigger you'd want to be careful, as it is crossing a line.
    1 point
  43. Hi Soma, I love this theme; the fixed position Save button is something I'd been meaning to fork into a theme for a while, lovely I just thought I'd let you know I saw an error with the theme when accessing the Modules Manager: Sorry to be the bringer of a bug and thanks again for the theme
    1 point
  44. I was originally thinking it would be something fairly simple where you could just swap out the files from the default profile with new files, and have it ready to go. And that would be plenty useful. But it would probably be better to go further and try to account for most of the elements. At least, I think this would be more useful to people that want to literally use it to build a site from. So it would be nice to have more than what's currently with the default profile... like a template that uses the slideshow (or ability for any template to use it), a contact form, ability to use the various list styles and menus/button bars, tables, captions with images, icons, etc. (we'll need Soma's expertise with configuring TinyMCE for some of this). All the while keeping the layout and look simple and generic enough that someone could also easily build from it as a base. How about you handle the front end and I'll handle the back end? Let me know if that's of interest, or if you have other ideas? Perhaps some of this overlaps with your plans for HTML KickStart too? If we were to collaborate on this, it seems like it would be not just another profile but more likely one to replace the default profile included with ProcessWire (which is in need of replacement). Though I do think it's important that the next default profile be a little more mobile-friendly than the current one is. Anything that takes the default profile further also means we should include a second "blank" profile with PW (which we don't currently do, but I think we should). I was also excited to hear about your plans for HTML KickStart. Thanks for the shoutout too.
    1 point
  45. Thanks, I sometimes forget we support uppercase chars in field names (I don't use them myself). We can't support uppercase in permission names, since they are ultimately page names. But I think I can make this case insensitive. This won't be a problem, as you can't have two fields with the same name from the DB side, of different case. Can you tell me if this update fixes it for you? https://github.com/ryancramerdesign/PageEditFieldPermission/commit/449dee6eabd3e7adc733ae829568f1828a5d87b5
    1 point
  46. I found Janko's FormToWizard code to be one of the simplest ways to implement a multi-page/multi-slide form. Now with the Processwire this just got easier. I tweaked his script a wee bit to work with the API forms described in this thread. PWformToWizard.js bunching your fields into fieldsets just as Ryan described above, each fieldset will become a page/slide. Instead using the <legend> tag that Janko uses, the script now generates a legend based on the label, specifically anything that comes before a colon ':' first add the script: <script type="text/javascript" src="PWformToWizard.js"></script> then use this javascript to initiallize formToWizard: $("#SignupForm").formToWizard(); the default styles are: <style type="text/css"> body { font-family:Lucida Sans, Arial, Helvetica, Sans-Serif; font-size:13px; margin:20px;} #main { width:960px; margin: 0px auto; border:solid 1px #b2b3b5; -moz-border-radius:10px; padding:20px; background-color:#f6f6f6;} #header { text-align:center; border-bottom:solid 1px #b2b3b5; margin: 0 0 20px 0; } fieldset { border:none; width:320px;} legend { font-size:18px; margin:0px; padding:10px 0px; color:#b0232a; font-weight:bold;} label { display:block; margin:15px 0 5px;} input[type=text], input[type=password] { width:300px; padding:5px; border:solid 1px #000;} .prev, .next { background-color:#b0232a; padding:5px 10px; color:#fff; text-decoration:none;} .prev:hover, .next:hover { background-color:#000; text-decoration:none;} .prev { float:left;} .next { float:right;} #steps { list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;} #steps li {font-size:24px; float:left; padding:10px; color:#b0b1b3;} #steps li span {font-size:11px; display:block;} #steps li.current { color:#000;} #makeWizard { background-color:#b0232a; color:#fff; padding:5px 10px; text-decoration:none; font-size:18px;} #makeWizard:hover { background-color:#000;} </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript" src="formToWizard.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#SignupForm").formToWizard({ submitButton: 'SaveAccount' }) }); </script> see janko's page for more info~ Now, just to add some responsive jquery validation to each 'next' button...
    1 point
  47. Haven't read that well. Ok, this is kinda hard to make it short, there's many way to archive this in different levels. Are those users public-registered users or trusted users you give explicit accounts? Just to give the most restricted, just front-end users: Create appropriate roles or permissions. Like a "frontend_editor" Role and only add page view permission. You give only guest and this new role to the users. When they login via backend they won't see anything and get redirected to front-page. Voila. In your templates and modules you check for the Role the user if($user->hasRole("frontend_editor")){ // do stuff } else { // do other stuff } Edit: To give access to only certain field to edit. Well since you only have a front-end user with no access to anything, you control it via code in template. And my examples above shows a "$ignore_fields" array you could choose to ecxlude certain fields as you create the form this is simple. But anything possible in PW. There's a module that enables per field limit access by Ryan http://modules.proce...eld-permission/ might be something to try. Don't know if it works with the form rendering method here. To restrict certain users to pages. Since need to know which pages a user has you can add a page field to the user template, so you can add pages a user can edit by editing it's profile. Then you can check in your front-end code if a page he wants to edit is in his added pages. For adding pages you'll have to have to parent page field or something. // does the page field contain the page he wants to edit? if($user->editable_pages->has($editpage)){ // do edit form stuff } Or just use one page that is the parent of a branch he can "work". Use this to redirect the user to his page and do stuff and always check if the user has the rights when you do something. /Just to give some examples
    1 point
  48. Not sure what in detail you need, but got some example code mainly taken from the Template Form Processor render a pages form to edit in front-end. https://gist.github.com/somatonic/5011926#file-from-php Now you need to include scripts and css needed. Note this $config stuff is only populated after you generated the form in API. In the head.inc you could include script (taken from the admin template default.php and modified a little). Also you would maybe need the inputfields.css found in the admin templates folder. This somehwhere in the <head> Moved code to gist.github.com for convenience.. https://gist.github.com/somatonic/5011926#file-head-php This will give you the basic things needed, I have not tested all fields, but file uploads and date picker or even custom color picker etc works fine.
    1 point
  49. Very nice Soma. I really like a lot of what you are doing with this theme. And you beat me to those pulldowns–well done! I like how they work. Great job with this theme. Only details that came up as questions during testing (and these are really minor): In the PageList, the children counts are resting on a lower baseline than everything else. I also had a little trouble with asmSelect fields (like Page references) with the colors being the same as the container. Like I said, pretty minor. The diamond icon you have in the PageList presents some interesting possibilities, and it got me thinking. At first I thought it was a replacement for the 'move' link or something to indicate a page status. While it's only decorative now, it seems like down the road maybe there is possibility (whether in this theme or another) of having a preceding icon that is functional, whether to indicate the page's status, template, or something like that. Indicating the page's template with an icon (configured per template) was Adam's idea months ago, and I've always thought it was a good one. Though probably something we need to add to the core to make it work.
    1 point
  50. Thanks guys. I modified few lines on Ryan's snippet (to add level-n to class): <?php function treeMenu(Page $page = null, Page $rootPage = null) { if(is_null($page)) $page = wire('page'); if(is_null($rootPage)) $rootPage = wire('pages')->get('/'); $out = "\n<ul>"; $parents = $page->parents; foreach($rootPage->children as $child) { $class = "level-" . count($child->parents); $s = ''; if($child->numChildren && $parents->has($child)) { $class .= " on_parent"; $s = str_replace("\n", "\n\t\t", treeMenu($page, $child)); } else if($child === $page) { $class .= " on_page"; if($page->numChildren) $s = str_replace("\n", "\n\t\t", treeMenu($page, $page)); } $class = " class='$class'"; $out .= "\n\t<li>\n\t\t<a$class href='{$child->url}'>{$child->title}</a>$s\n\t</li>"; } $out .= "\n</ul>"; return $out; } Works nicely! Actually learned few new tricks from this also. Reason for this script is that I want to build generic "default site" that can be used pretty much "out of the box". Of course good only for simple and generic sites, but I need something that sales guys can demo and let clients to play with. Of course this can be useful in other cases too.
    1 point
×
×
  • Create New...