Leaderboard
Popular Content
Showing content with the highest reputation on 04/16/2013 in all areas
-
I agree with renobird that it's pretty rough on the eyes, though I can see how it would appeal to kids. I get the impression that the designer must know his/her audience well. And we aren't that audience. But I can respect what they are doing here. I have to admit this reminds me a bit of geocities time when the web was a lot less designed, less serious, and more playful place. Not that I long for that period at all. But the period definitely had its own [youthful, tacky, random?] style about it.7 points
-
Here is a recent site done in processwire: http://licoriceensemble.com/ modules used include formbuilder procache cropimage version control for text fields after save actions based on a template by the great team at Elemis.4 points
-
Greetings, It's also easy to create tabs with a simple JQuery snippet. I put together a Fiddle, which I use on a lot of my sites: http://jsfiddle.net/matthewschenker/avP9W/ Just insert your own ProcessWire references, similar to what you see in the basic structure below: <ul id="simple-tabs"> <li><a id="tab1">Form 1</a></li> <li><a id="tab2">Form 2</a></li> <li><a id="tab3">Form 3</a></li> </ul> <div class="simple-tabs-container" id="tab1C"> <h2><?php $page->form1_name; ?></h2> [YOUR FORM1 ELEMENTS HERE] </div> <div class="simple-tabs-container" id="tab2C"> <h2><?php $page->form2_name; ?></h2> [YOUR FORM2 ELEMENTS HERE] </div> <div class="simple-tabs-container" id="tab3C"> <h2><?php $page->form3_name; ?></h2> [YOUR FORM3 ELEMENTS HERE] </div> Just call the JQuery script directly below the code shown above, then style it with your own CSS. Thanks, Matthew3 points
-
you can do the tabs with fields, repeaters or pages; depends on how flexible you need and the specific application. I've done tabs with all 3 scenarios; here are examples – note you will have to use the structure and class/ID names needed by your scenario (bootstrap etc..) 1.) Tabs using 2 fields on a page: <div class="tabs tab-container"> <ul class="etabs"> <li class="tab"><a href="#tab-1">Japanese</a></li> <li class="tab"><a href="#tab-2">English</a></li> </ul> <div class="panel-container"> <div id="tab-1"> <?php echo $page->bio_jp; ?> </div> <div id="tab-2"> <?php echo $page->bio_en; ?> </div> </div><!-- end panel container --> </div><!-- end tab-container --> Example 2 - tabs using repeaters: <?php //check to see if there are tabs if(count($page->tabs)) { ?> <div class="clear"></div> <div class="tabs tab-container"> <ul class="etabs"> <li class="tab"><a href="#tab-0">Additional Album Information</a></li> <?php $counter = 0; foreach($page->tabs as $tab) { $counter++; ?> <li class="tab"><a href="#tab-<?php echo $counter ?>"><?php echo $tab->tab_title ?></a></li> <?php } ?> </ul> <div class="panel-container"> <div id="tab-0"> <p>Please use the tabs to select further info.</p> </div> <?php $counter = 0; foreach($page->tabs as $tab) { $counter++; ?> <div id="tab-<?php echo $counter ?>"> <?php echo $tab->tab_content ?> </div><?php } ?> </div> <!-- end panel container --> </div><!-- end tab container --><?php } ?> Example 3 using child pages (bootstrap) <div class="content-tabs"> <!-- wrapper required --> <?php $tabs = $page->children; ?> <ul class="tabs"> <?php foreach ($tabs as $tabtitle) { ?> <li class="tab"> <a href="#<?php echo $tabtitle->name; ?>"><?php echo $tabtitle->title ?></a> </li><?php } ?> </ul> <div class="panels"> <?php foreach ($tabs as $tabcontent) { ?> <div class="pane" id="<?php echo $tabcontent->name; ?>"> <?php echo $tabcontent->body . "\n"; ?> </div> <!--close #<?php echo $tabcontent->name; ?> --><?php } ?> </div> <!--close panels--> </div> <!-- /.content-tabs-->3 points
-
2 points
-
We'll be adding more configurability to repeaters in the next version or so, including an option to have them collapsed by default (the repeater items themselves), ability to control labels of repeater items, and automatic sorting.2 points
-
Make sure you do it a odd number of times, so Ryan gets at least one like from you2 points
-
Go ahead and make your module implement ConfigurableModule, even if you don't want any interactive configuration: class MyModule extends WireData implements Module, ConfigurableModule { Add a getModuleConfigInputfields function to your class that just does this: public function getModuleConfigInputfields(array $data) { return new InputfieldWrapper(); } For data that you want to store, call upon the $modules API var like this: $data = array('foo' => 'hello', 'bar' => 'goodbye'); wire('modules')->saveModuleConfigData($this, $data); For data that you want to retrieve: $data = wire('modules')->getModuleConfigData($this); Your config data will be populated to your module automatically after __construct() but before init(). As a result, you might want to set default values in your __construct(): public function __construct() { $this->set('foo', 'hi'); $this->set('bar', 'bye'); } public function init() { // $this->foo is now 'hello' (not 'hi') // $this->bar is now 'goodbye' (not 'bye') } Using this method, your module can always access it's config data directly via $this->foo and $this->bar. Meaning, you probably won't ever need to use the getModuleConfigData() function, but it's good to know its there. However, you will need to use the saveModuleConfigData() function since you are saving configuration data non-interactively.2 points
-
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 points
-
Hi Peter, Just wanted to point out that there are couple of interesting discussions related to custom forms around; this one for an example. Essentially you'll have to create a form, by using PW elements or your own, and mostly put the logic together yourself. Depends of course a lot on what you're trying to achieve; simply sanitizing and saving user submitted content to pages (or users or..) is very simple to do via API, as you most likely already knew Lately we've been using Ryan's great Form Builder for almost all of our front-end custom forms stuff. It's super versatile and in the long run saves so much time that it's well worth the cost ($39.00 USD for one site etc.)2 points
-
Quick and dirty solution would be to had this line to your admin-theme: $(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed"); you could add it in the end of the main.js file for instance $(document).ready(function() { ProcessWireAdminTheme.init(); // very dirty hack to collapse the repeaters, make something nicer later $(".Inputfield_repeater .ui-sortable > li").addClass("InputfieldStateCollapsed"); });2 points
-
This module generates a "stubs.php" file containing PHP-classes with documentation for the properties of each Template, based on it's fields - which means IDE support (auto-complete, inspections, documentation) for templates in modern IDEs that perform static analysis, such as PhpStorm. The output looks like this: <?php /** * Generated by TemplateStubs module 2013-04-13 15:29:33 * This file may be overwritten at any time. */ namespace tpl; use Page; /** * "basic-page" template * * @property string $title Title * @property string $headline Use this instead of the Title if a longer headline is needed than what you want to appear in navigation. * @property string $summary Summary * @property string $body Body Content * @property string $sidebar Sidebar * @property Pageimages|Pageimage[] $images Images */ class basicpage extends Page {} To use the generated documentation, start your template-file like this: <?php /** * @var tpl\basicpage $page */ Documentation and more details on this page: https://github.com/mindplay-dk/TemplateStubs You can consider this an alpha-release - I haven't tagged a release yet, and some details like template-class naming convention may change before I tag release 1.0.1 point
-
I am looking for an experienced PW developer who helps to setup a site with PW and add liquid design/mobile features. multilingual design is ready content will be maintained by a editors role (editors/translators/SEO) and moderated by a supervisor role (boss, legal dept., whatever): A module needs to be added, introducing approval of changed content (this module could end up as sponsored open source here) Language for developing: German or English. I want to do this project as soon as possible - thats the main point actually, so time is an issue and I need s.o. who is already familiar with the bells an whistles of PW. Code needs to be of a good quality, well doumented and as secure as possible. Project is under NDA More projects to come; we are just starting the switch from Drupal and static webpages. Next project: Connecting a PW site with the cool new xenforo Forums...1 point
-
the config "data" field in db is a "TEXT" field so about ~64kb. Module config is stored as JSON and to store 5mb of data you would need a MEDIUMTEXT field ~16mb. Of course you can, but depending on your data and for what it's used it's maybe not a good strategie. To add another possibility, you could add a textarea (MEDIUMTEXT) field to the "admin" template, and store the data there. But if you would need flexible and larger data stored I would certainly also consider using pages.1 point
-
1 point
-
Matthew, Thanks for this. Small typo, the last li -> a also has id= 2 instead of id = 3. Good example!1 point
-
hi, is this page hacked? this what I see when I clicked on http://wonder-tonic.com/geocitiesizer/content.php?theme=2&music=8&url=http://processwire.com/1 point
-
1 point
-
Hey Everyone, Yeah, I agree that the style is a bit over-the-top with this one. However, the site is actually gaining in popularity from what I gathered. Of course, they can take more chances since they are associated with the Whitney! I would not design a site like this myself. However, my focus is on the various interactive/community elements this site contains. I'm glad to see organizations building their own unique, creative social networking elements and not only serving as another cog in the Facebook gearbox. And I think it's a good example of what can be done with ProcessWire. Thanks, Matthew1 point
-
http://wonder-tonic.com/geocitiesizer/content.php?theme=2&music=8&url=http://processwire.com/ or indeed http://wonder-tonic.com/geocitiesizer/content.php?theme=3&music=5&url=http://processwire.com/talk/topic/3267-simply-interesting-for-processwire/ (2nd one is a bit meta)1 point
-
Ryan, ROFL! *repeatedly pressing the like button* Phew, that got me.1 point
-
I think that file/image/page URLs in textareas are the only place where the issue can occur. It happens just because editors like TinyMCE are storing ready-to-output HTML. Everywhere else in ProcessWire (except cache files), everything is stored as references, so it doesn't matter where the site is running. Our eventual built-in solution will just ensure that any local URLs in textareas are always saved as if the site were running from root (via the sleepValue function), and prepend any subdirs to root paths at runtime (via the wakeupValue function).1 point
-
I think that module only imports data into existing fields. And the 'issue' with the profile exporter is that it's an all or nothing approach - which is great - but I'm after a selective approach to adding multiple fields. For example my 'Settings' page would have anything from five to a dozen fields of various types: textfields for site name, email field for contact emails, check boxes for toggling sidebars on and off... the list goes on.1 point
-
I really think the best way is to use pages. If you organize things well, those pages will never get in the way of the main structure because they will be collapsed under their parent. This is how people organize data in computers for years. The fact that you use pages will allow you to use the api, and this will make it so much easier to create a frontend or backend system to consult that data.1 point
-
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/53913911 point
-
1 point
-
If you use a different template on the pages that shouldn't be view-able (I assume everything but home), and that template does not have an associated file (example "basic-page" template has "basic-page.php") then the view button itself will not be shown. Another option is maybe to just use a repeater for the content blocks and then genuinely only have one page in the admin (home) and remove the other. Hope that helps.1 point
-
You only have a handful of Page objects and Fields? I think you misunderstood - this does not provide IDE support for ProcessWire (which still needs a lot of work in this area) but for your templates and fields. I'm sure you have more than a handful on complex sites, and I'm prertty sure they're not always the same? It's not about simple or difficult, it's about proofing your work - knowing in advance if you misspelled a property-name, or not having to go back to find the name of a property on an admin-screen, it saves time. With inspections in PhpStorm, there is also the added benefit of being able to automatically find errors - if you have dozens of templates and you have to make a change like renaming or deleting a field, automatic inspections will instantly reveal which templates are affected. Most of my day-to-day work is not little projects, but large complicated business-systems - while I used to be able to keep it all in my head, I'm not getting any younger. A good IDE will help you stay fast and accurate when you grow older, wait and see1 point
-
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.1 point
-
Thanks Luis. - so have to say: I only want put together the basic stuff but also want to keep it modular and scalable. For example I personally only use mp3-files but if people use other formats like ogg they should be able to extend the class module for that easily. Maybe with some help it could become really nice and not only poor basic ;-) If someone has good skills on how to build / design / layout admin pages with that UI-stuff it would be really helpful if he/she could design the output for the backend. Also if someone is good with frontend design and want to collaborate that would be great too. I have a really short screencast of what I have done till now, (most of this was learning how to send green or red messages to admin screen, how / where to store config data, to create permissions and roles, and basically how to create a module that has a page in the admin section, ...): https://youtu.be/u_S8ajLkzRI Next steps are to parse ID3Tags, compare file-data with DB-data and import new tracks. Question: is it possible to store arrays or WireData on a page?1 point
-
I like your idea and different people here actually customise the manager to suit their preferences/needs. However, I think this is one of those things that is left to the user to decide so that PW doesn't box you into any design. In fact, the default installation is just a demo page. In your case, you have need for a "maintain" section. Not everybody does. The beauty with PW is one can do what they wish with the manager as with everything else. Have a look at the different admin themes available for download here and you'll see what I mean. . One can even decide not to have a manager at all and PW will still run1 point
-
In Fields.php#415, the invokation of changedType() doesn't match the hook method - you forgot to pass in the $fromType and $toType arguments. EDIT: I added the missing $fromType and $toType arguments and integrate the new hooks - I noticed one important change immediately, when changing the Field-type, there are actually two events during the same request, first changedType() and secondly saved(), and those get correctly recorded as one migration, in the correct order. So this works much better and is surely much safer than the controller-hooks. Thanks!1 point
-
1 point
-
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.1 point
-
I've tagged and released version 1.0.4 with various minor improvements and fixes. NOTE: uninstall 1.0.3 before upgrading! It looks like dependency on the new icon-selector causes breakage if you simply drop in the new files.1 point
-
Wow, what a great community! I'm embarrassing to say that Adrian was spot on when he asked if the field had a label defined . The products has 25+ custom fields and I labeled all but, of course, the price field. $product->fields->product_price->label did work so thank you all for helping me!1 point
-
Your service provider probably already has set these parameters. They are not allowing you to override them. Normally you would not want indexes displayed in application folders or on a normal site, Which is why you you see empty index.html files in directories in some applications or the -Indexes directive in your .htaccess file. You can test for this condition by going to a folder without a directory index file, that has other resources. If you don't see anything then indexing is not on in for that host (or implicitly set on that dir) I am pretty sure Processwire is not using symbolic links. It is possible that someone could or did write a module that does. Just none that I am aware of. If you create some yourself, you won't be able to follow them in, Apache if this directive is not enabled. I know that drupal does need this directive for a private download method in the core. Not sure why it is present in the PW .htaccess file. From the Apache Docs.. Indexes If a URL which maps to a directory is requested, and there is no DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory. FollowSymLinks The server will follow symbolic links in this directory. http://httpd.apache.org/docs/2.2/mod/core.html#options1 point
-
Dear Ryan, Thank you! ProcessWire just keeps getting better and better! Peter1 point
-
Been using Ryans code for the login page and I'm finding I get a server error if the user enters a username which includes an @ the error seems to be coming from: $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; // this line has nothing to do with the problem, just left it in for consistency $u = $users->get($username); When sanitizing the username, the value we get back is not loved by the $users selector. The error is logged as: For myself I didn't need the user to be able to enter @ as I'm not passing an email, therefore I've flipped out the sanitizer to use name instead, i.e. $username = $sanitizer->name($input->post->username); I assumed this was a bug with the username sanitizer, however if there's a code change I could make it would be great to hear.1 point
-
Sounds good - though I am somewhat concerned about the reserved keys in $options, but I guess that's inevitable since they're already in use. They should probably be documented in the API, so that people don't accidentally overwrite reserved values. EDIT: you did already document them1 point
-
Hey Ryan, I don't really want to have a template for the person pages, because unless I am not understanding, this would result in search returning links to pages like: /people/joe-blogs/ The would be a page that doesn't exist within the site's menu system and would send the user to something out of context. The template for my staff vs partners is also quite different - I want quite different output I was tempted to just separate and duplicate those people that are multiple categories, but that goes against the grain and doesn't make sense. I really like the simplicity of your approach to just handle the search output differently for a specific template. Obviously much cleaner and more scalable than my approach. What I was attempting to do with that messy code above was create something portable (although I agree it probably doesn't scale very well). They way that code works is to look for any field names in the matched pages foreach($m->fields as $field) { that match page names elsewhere in the page tree $pagematches = $pages->find("name={$field->name}"); For each match where the field is checked, generate a page with the matched page name. if($pagescount>0){ foreach($pagematches as $pm){ if($m->$field!=0){ So this code can be used (I think ) to match any of these scenarios that come up, without having to define the templates that need different treatment. That said, if you couldn't understand it, then it probably isn't a good approach. I'll probably leave it as is for now since it seems to work fine, but maybe next time I come across this situation I'll take your approach instead, unless you can think of a way to clean up what I have into something that could be scalable and fully portable I still have in my mind some module that would allow the ability to define custom rules to manipulate the pagearray based on these sorts of categorizations so that all API calls were seamless. In this example, people/person would be removed from the pagarray and About > Staff > Partners > Affiliates > Partners > Contractors > would be manipulated to return the fields and data from the person template. Although as I try to describe this, it sounds pretty messy1 point
-
1 point
-
Create an account on transifex and I add you into a project. It seems to be a very nice tool for doing translations in collaboration. Translations are easiest way for many people to "give back", and current way isn't very easy to get started. In github model you don't even see the original strings, which makes it clumsy. I think that tool like Transifex would lower the barrier to contribute and manage translations.1 point
-
Looks like you are on the right track there. As for the field name and/or id, I'm guessing you don't want to use the title though. In order to make sure you've got something unique, you might want to use "myfield{$cat->id}" or something like that. If you don't need to support images/files in repeaters, then it won't be too difficult. You would add one or more repeater items at the end, but make them hidden or collapsed. You could have a little javascript link that says "add item" and when clicked, it unhides the next one. Make the fields in each follow a different name format, like "myfield_new1" for the first one, "myfield_new2" for the second one, etc. Basically, some name format that your processor would know is referring to a new item it should add. Then it could process them like this: $n = 1; $name = "myfield_new$n"; while($input->post->$name) { $item = $mypage->myrepeater->getNewItem() // populate any fields in the repeater you want $item->title = $input->post->$name; $item->save(); $mypage->myrepeater->add($item); $n++; $name = "myfield_new$n"; } if($n > 1) $mypage->save('myrepeater');1 point
-
The whole idea of a maintenance mode is something to be careful with on a site that depends on any kind of search traffic. It's not a great idea to make a habit of it, that's for sure. So if you need to put a site in maintenance mode, try not to do it for long. Personally, I have never had the need for a maintenance mode. Though there have been a couple times where I was pushing in a major update to a site, and I temporarily added the following to the top of the /index.php file: die("Go away! We are trying to upgrade the site.");1 point
-
Greetings, Thanks Ryan... Yes, at the moment I am simply showing what's possible, so the table loads all 533 pages and all 58 fields at once! This is NOT the way it will work when the site launches. However, it's a good test in a way because it's loading all of that data -- and on a shared server. ProcessWire performs well! For the real site, only maybe 10 fields will be included in the table, and I am planning to have the user choose pre-filters before the table renders. I really like using DataTables with ProcessWire. In fact, the two are similar in their attention to detail and clean code. With a little creativity, DataTables can be part of a custom ProcessWire interface for clients. More on that later! Thanks, Matthew1 point
-
Once the multi-language page names module is stable and in production use. So will probably start developing the namespaces stuff in May. Namespaces are the primary aim, with PSR-0 being a natural extension of that. I plan to shoot for PSR-1 too if it looks like it'll benefit our audience. Also as a natural extension to these updates, I am interested in supporting Composer, and will do so if possible. I agree it's a great asset for PHP, though am less certain if it's as much of a draw for ProcessWire's primary audience. Throughout all of these 2.4 updates, I feel a lot of care will have to be taken to balance these updates with other improvements to the system. After all, our audience is primarily web designers and developers, and less purely PHP coders. I think a majority of our users doesn't actually care about namespaces, PSR standards and Composer, so I don't want to get too far off track, even if I personally have a strong desire for these things. But the driving aim of 2.4 is to help ProcessWire benefit from PHP 5.3+ as much as possible. This likely includes all of the things outlined. I've always been interested in this. PW started as just the content framework, and underneath it still is. I'd like to retain and reinforce those roots. But don't think I want to actively maintain PW as two projects until there is real need for it (just as a matter of resources). I'd like to make it easy for people to integrate components if they want to, and I think Composer is probably the way to do that. But don't currently see a need for any of our core components to come from another framework. Though I'm always open to the idea if there is a real benefit to our users. IoC is not a new concept. ProcessWire was written with an emphasis on best practices, patterns and concepts like this, everywhere beneficial to the project goals. The primary need for unit tests in PW has been with the selector engine, both DB and in-memory, and the consistency of the two. Luckily this is an active project, and it has already been hugely helpful and influential in ProcessWire 2.3 (thanks to Nik). In fact, I would probably consider the issues discovered and resulting solutions the most important upgrade to come with ProcessWire 2.3.1 point
-
Actually, I would argue they are not fine for enterprises either. I sat on a help line today while a furious amount of typing was going on the other end - complete with lots of "needed" questions. The call probably took 3 or 4 minutes longer than needed. Okay for me, but multiply that up by however many thousands of calls that company receives and the wasted time and resources is vast. Even with internet forms. I was submitting a bug somewhere the other day, and I needed to fill in OS, Browser, browser version, my machine OS, date, full name, dogs name, and so on and so forth. Then in the bug fields I wrote "You have got the date wrong on the script." So, a ton of information that was not required, got stored and some poor bugger had to read before getting to the actual information. The clever thing about old fashioned help system (some trained individual standing behind a counter with a pencil shoved behind their ear) was that they asked what the problem was FIRST and then asked for additional information based on not what the system said do, but what the problem actually was. And it was 100 times more astute than the automated variety. Enter your problem. "My site is offline." Please choose one of the following from our helpful FAQ: "What to do when your lawnmower breaks down." "The best place to buy chickens" "How to get your wall vertical." I once wrote a TV sketch about it (that didn't get used). A person walked into a store, went to the information desk and said hello. For the next ten minutes the helpful person asked loads of nice questions, took down details and so on at the end of which they asked what the problem was. "I have just backed into your car."1 point