Leaderboard
Popular Content
Showing content with the highest reputation on 02/06/2014 in all areas
-
Hey folks, just wanted to add this side project to the list of incredible ProcessWire sites. http://www.brenztapete.de/ http://www.brenztapete.de/2013/oggenhausener-sonnenuntergang/ It's a site where you can download Wallpaper, taken in my home town Heidenheim. The idea was to ask more photographers to add pictures but thats currently only a future plan. The whole site didn't took any longer than one evening. ProcessWire 2.3.x dev with ProCache Apeisas Thumbnailmodule for the cropped variations of the image Some Lazyloading JS magic Responsive CSS Grid. Anyone interested in a site profile from this page?7 points
-
Just launched a new Processwire site, http://luxcommunications.ca Comments? Feedback? As always, if you find any bugs or problems please let me know.6 points
-
Hey reno, You can set your defaults like this. Just put it before your init(): protected static $configDefaults = array( "defaultSelector" => "default value here" ); /** * Data as used by the get/set functions * */ protected $data = array(); Add this line to your inputfield: $field->attr('value', $data["defaultSelector"]); And add the following at the top of your static public function getModuleConfigInputfields(array $data) {: foreach(self::$configDefaults as $key => $value) { if(!isset($data[$key]) || $data[$key]=='') $data[$key] = $value; } You can then access this throughout your module using: $this->defaultSelector; At least that is how I have been doing it - maybe someone else has something cleaner Does that make sense? PS, Sorry for all the consecutive edits. I really shouldn't try to offer device when I am busy with other things and rushing EDIT Again - I just read that tutorial you pointed to and I see if uses: public function __construct() to set the default values. I haven't used that before. I guess I started by copying from other modules and never came across that approach. I guess there are a few different options, but construct does seem cleaner.6 points
-
5 points
-
Please consider this a formal request and/or a question about why we are not allowed to use spaces in passwords in the admin. Doesn't adding a few spaces to a password or passphrase significantly increases its security? Even the horrible example "This is my password." is much more secure than most passwords people pick for themselves (Possible Combinations: 10,596,610,576,391,421,000,000,000,000,000,000,000), more secure than the same characters sans-spaces, and likely easier and more natural to type. Personally, I'd rather have a length requirement than be forced to use a digit and no spaces. Everyone has their own methods I suppose, so I was wondering if someone could shed some light on this?4 points
-
Hi One of our last PW projects. The client: a little café in our beautiful little town of Freising near Munich. Site ist not finished yet... Feedback and suggestions welcome! http://www.parkcafe-freising.de4 points
-
Congrats to Beate for being the 1800th user! You won a prize: New Checkbox Inputfield settings!4 points
-
And add the following at the top of your static public function getModuleConfigInputfields(array $data) {: foreach(self::$configDefaults as $key => $value) { if(!isset($data[$key]) || $data[$key]=='') $data[$key] = $value; } Be careful here, only keys that are not set in the $data array should inherit the default value. Otherwise if a config value is empty, you'd overwrite it with the default value all the time, if the default value ist not empty. Suppose a checkbox with possible values 1 and '' default=1 (checked) User opens Module Config and does uncheck the box After reloading, the box would be displayed as checked Setting the default data in the constructor makes sure that you'll have every config key available as property (->key). The workflow here is: Pw creates your module --> calls constructor Pw does set all the stored config values to the module Pw calls init() method As you can see, modified default config values will get overridden in step 2. Default config values that are not yet stored in the database are set by you in the constructor.4 points
-
As you wait for other responses, have a look at the following examples from AdminSaveActions module. It looks really straightforward. Thanks for asking this question...I'll be needing this soon . Seems, you set the defaults in one function, then build the form/fields in another function using the defaults previously set...or something along those lines AdminSaveActions module static public function getDefaultConfig() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L51 public function __construct() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L105 public static function getModuleConfigInputfields(array $data) {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L390 MaintenanceMode module static public function getDefaultData() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L25 public function __construct() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L38 static public function getModuleConfigInputfields(array $data) {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L52 ProcessTrashman - Last one, static public function getDefaultData() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L42 public function __construct() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L54 static public function getModuleConfigInputfields(array $data) {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L255 MarkupRSS module - Sorry, the very last one (this one has more detailed defaults and some notes) protected static $defaultConfigData = array() https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L32 public function __construct() {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L67 static public function getModuleConfigInputfields(array $data) {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L219 Tutorial on forum - Create your first Module with configuration settings and a overview page: http://processwire.com/talk/topic/2318-create-your-first-module-with-configuration-settings-and-a-overview-page/ However, this Tut does not set defaults, which I think I have read somewhere is good practice to do? OK, sorry, am overdoing it but this will help me later too ;-) Edit: corrected wrong links + added a tutorial from the forums Edit 2: Something has been eating my links! Anyway, added methods/properties names...4 points
-
I'm not sure if this is what you are looking for, but I use HeidiSQL on my Desktop to manage all MySQL-DBs. It is possible to transfer complete Data or only selected tables from one DB to another on the fly with just a few clicks. Really quick and simple. (It is native for Windows or for Mac/Linux/*nix via Wine, or from a VirtualBox with a Win-Image)3 points
-
Lately i've put together this rather standard website for a german beer brewery manufactory: http://schwarzwald-gold.com Design is all by me, except the logo, which was done by a graphic designer. The new Foundation 5 was used as base. For the slideshow i used layerslider, the client could create his own slideshows and assign it to every piece of content. The client wished to have configurable blocks of content, which i realised with repeaters that can be adjusted to display just text, text with a left or right aligned picture and can choose to include a slideshow at the end of the block. The contact form is based on the code from Soma.3 points
-
There is a workaround, but it changes the value that is sent: $field->checkedValue = 'Yes'; Displays 'yes' as label3 points
-
3 points
-
Thanks ceberlin! This is just a soft launch of 2.4, as I've still got some items to cover before telling everyone about it. However, I was feeling that 2.4 is already a lot better and more stable than 2.3, and that there's just no reason to have people download 2.3 anymore. So 2.4 is now the stable version, but it will still be getting some minor incremental updates for a little while. For those upgrading, be sure to read the upgrade instructions and additional upgrade notes.3 points
-
2 points
-
From what I understand, you want to be able to rename an image during the upload process. A couple of options: Install Custom Upload Names and define rules for what files should be named what Hook into Pagefile::install and work with this code from Ryan Let us know if you need any specific help.2 points
-
As being a active member of this sports club, i've been asked to take over the website-development, so i'm developing this site in my spare time. http://tbe1844.de Developed first with Twitter Bootstrap v.2, but then converted it to version 3, which went comparatively smooth and easy. Every section could be managed by the staff from this section by restricting admin access for paths to users. This is still in development, especially the event managment needs some engagement. It is planned that it should be easy to generate a view of events distinct to a section or team and display this in a calendar or list... I implemented also a ranking list for the beach volleyball teams. It is based on the ELO-system used by chess or table soccer, the ranking points you get for a win or loss are calculated based on the points for both teams before the game. The ranking list is private, so if you wanna take a look, send me a pn. Modules used: Image thumbnails Fredi Hanna Code (you can insert tooltips to persons and locations in the editor) Page edit per user Map Marker2 points
-
U I often use $field = $modules->get("InputfieldMarkup"); $field->value = "<label><input type='checkbox' name='newsletter'>Ja, ich möchte per E-Mail über Neuheiten informiert werden</label>"; $form->append($field); Also you could use InputfieldCheckboxes and use addOptions(key, value) so you can set to not display header, but it will make the checkbox name an array $field = $modules->get("InputfieldCheckboxes"); $field->skipLabel = Inputfield::skipLabelHeader; $field->addOption("newsletter", "Ja, ich möchte per E-Mail über Neuheiten informiert werden"); $form->append($field);2 points
-
@n0sleeves Just following up on the idea of using git to control pushing from a dev to production situation (preferably via a test stage) and ignoring the DB sync issue for now. Caveat: Although I haven't exactly done all of what I'm about to suggest here, I have been using elements of these things for a while but never tied them together. I started using this model of linked github repos a couple of years back1. If you read the article, you'll see that it addresses a lot of what you want to do to a degree - pushing from one of the (possibly many) development copies to the 'hub' automatically gets reflected in 'prime' - his live site. If you also adopted a disciplined use of something like Vincent Driessen's Gitflow Branching Model2 (where the master branch in your repos is the only one representing releases) and make sure that the working directory on prime only ever has master checked out then you could even commit work-in-progress in other branches to your hub (thus backing it up) and not have it show up on your live site. Only when you pushed up a change to the master branch would prime's staging area change and hence the live site get updated. Anyway, hope that helps with at least part of the problem. 1 Actually, I used that article as the basis for automatically backing up my git repos by (sort-of) reversing his model. I had the bare 'hub' physically located on a remote external hard disk which was then SSHFS mounted into my local filesystem every time my machine booted. I worked on the 'prime' side of things - which was my local development repo, not a live server - and pushing a change locally was automatically mirrored onto my offsite bare 'hub' backup thanks to git hooks. 2 There are repos (original and more up-to-date clones) that provide command line tools to implement his model. Edited to add: I'll update the readme file for the script I use to create 'hub' and 'prime' repos and put the script up on github in a while. Edited to add: I no longer use the Gitflow branching model - I find it cumbersome. There are plenty of alternatives.2 points
-
Just wanted to share what I recently used to create forms in modules and in frontend using the API and Inputfield modules PW provides and uses on its own. I think many newcomers or also advanced user aren't aware what is already possible in templates with some simple and flexible code. Learning this can greatly help in any aspect when you develop with PW. It's not as easy and powerful as FormBuilder but a great example of what can be archieved within PW. Really? Tell me more The output markup generated with something like echo $form->render(); will be a like the one you get with FormBuilder or admin forms in backend. It's what PW is made of. Now since 2.2.5~ somewhere, the "required" option is possible for all fields (previous not) and that makes it easier a lot for validation and also it renders inline errors already nicely (due to Ryan FormBuilder yah!). For example the Password inputfield already provides two field to confirm the password and will validate it. De- and encryption method also exists. Or you can also use columns width setting for a field, which was added not so long ago. Some fields like Asm MultiSelect would require to also include their css and js to work but haven't tried. Also file uploads isn't there, but maybe at some point there will be more options. It would be still possible to code your own uploader when the form is submitted. Validation? If you understand a little more how PW works with forms and inputfields you can simply add you own validation, do hooks and lots of magic with very easy code to read and maintain. You can also use the processInput($input->post) method of a form that PW uses itself to validate a form. So getting to see if there was any errors is simply checking for $form->getErrors();. Also the $form->processInput($input->post) will prevent CSRF attacks and the form will append a hidden field automaticly. It's also worth noting that processInput() will work also with an array (key=>value) of data it doesn't have to be the one from $input->post. Styling? It works well if you take your own CSS or just pick the inputfields.css from the templates-admin folder as a start. Also the CSS file from the wire/modules/InputfieldRadios module can be helpful to add. And that's it. It's not very hard to get it display nicely. Here an code example of a simple form. <?php $out = ''; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'subscribe-form'); // create a text input $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form->append($field); // append the field to the form // create email field $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name','email'); $field->required = 1; $form->append($field); // append the field // you get the idea $field = $modules->get("InputfieldPassword"); $field->label = "Passwort"; $field->attr("id+name","pass"); $field->required = 1; $form->append($field); // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Subscribe"); $submit->attr("id+name","submit"); $form->append($submit); // form was submitted so we process the form if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); // here is a good point for extra/custom validation and manipulate fields $email = $form->get("email"); if($email && (strpos($email->value,'@hotmail') !== FALSE)){ // attach an error to the field // and it will get displayed along the field $email->error("Sorry we don't accept hotmail addresses for now."); } if($form->getErrors()) { // the form is processed and populated // but contains errors $out .= $form->render(); } else { // do with the form what you like, create and save it as page // or send emails. to get the values you can use // $email = $form->get("email")->value; // $name = $form->get("name")->value; // $pass = $form->get("pass")->value; // // to sanitize input // $name = $sanitizer->text($input->post->name); // $email = $sanitizer->email($form->get("email")->value); $out .= "<p>Thanks! Your submission was successful."; } } else { // render out form without processing $out .= $form->render(); } include("./head.inc"); echo $out; include("./foot.inc"); Here the code snippet as gist github: https://gist.github.com/4027908 Maybe there's something I'm not aware of yet, so if there something to still care about just let me know. Maybe some example of hooks could be appended here too. Thanks Edit March 2017: This code still works in PW2.8 and PW3.1 point
-
Please read this first as this is very similar to what I currently do: http://www.sitepoint.com/forums/showthread.php?1183418-Using-git-with-a-CMS-for-version-control-and-deployment. What I want to do with multiple machines I see all this talk about using the cloud with your local dev. environment and linking your local server to it so that you may edit and work on your files across multiple computers. I too am even contemplating this workflow and see why it’s so popular. However, it just seems like an extra step when there is Git available. Tell me if the workflow I am considering makes sense or not please. Although I have been researching for the four days, I am still new to Git and command-line, but I have become familiar with it over the weekend and really want to use a command-line/Git workflow. I have always developed sites the old-fashioned way (code, ftp, rinse, lather, repeat). Here is what I am contemplating: Develop locally in the default installation of WAMP. Commit files into Git local repo which my WAMP would be instructed to reference for it's "www and data" directory Push local repo to hosted private repo (Bitbucket) Pull hosted repo into live production server (not automatically since I want full control over when) If on another computer, pull / clone from Bitbucket and repeat My thinking is this could work with multiple computers as well, thus eliminating the need for Dropbox since the hosted repo will always have the most current version anyway. If I wanted to work on the site on another computer, couldn't I just clone the repo? The only hiccup I see is having to export/import the database each time. However, I am sure there is a way to automate this as well? I am interested in trying to come up with a way to keep the CMS's and it's database in sync as well. Is it possible to use the method I describe above? I’m curious to hear your thoughts and suggestions. Thank you very much for your time and knowledge. I would love to start a discussion on this because I really want to implement a better workflow, especially using Git with CMS's and if possible, it's databases.1 point
-
Hi Renobird, I assume you want to customize the breadcrumbs setup by ProcessPageAdd. I used a module for this particular project so it looks something like the below: class YourModule extends WireData implements Module { ... public function init() { $this->addHookAfter('ProcessPageAdd::execute', $this, 'pageAddExecuteAfter'); } public function pageAddExecuteAfter($event) { if($this->fuel('page')->process != 'ProcessPageAdd') return; //build your new breadcrumbs $breadcrumbs = new Breadcrumbs(); $breadcrumbs->add(...); //etc... $this->setFuel('breadcrumbs', null); // I forget if this is necessary, but it works. $this->setFuel('breadcrumbs', $breadcrumbs); } }1 point
-
Nienburg Mittelweser is a Region in Lower Saxony/Germany. Our Job was to create an official campaign that engages young familys and skilled workers to settle down in Nienburg. The campaign tries to communicate the benefits of deceleration and living in an rural region in a sympathetic way. Apart from developing the whole Logo/CD/Imagery/Text our job was to create a Microsite that gives interested people a brief overview of the benefits of living in this region. The microsite is (of course/as usual) powered by processwire. http://einfach-lebenswert.net/ For those who don't speak german ( ) here are the 3 keyvisuals headlines translated in english: --> GROSSBAUSTELLE = Large construction site [in Nienburg-Mittelweser] --> KONSUMTERROR = pressures of a materialistic society [in Nienburg-Mittelweser] --> RUSH HOUR = Rush Hour1 point
-
@totoff Not particularly. Unless you are investing in top end solutions like Nuendo and Nuage - but even then, the DAW part of the system is standalone and can run on either Mac or Windows, as far as I know (though they tend to illustrate it with a Mac) The original upsurge in Mac use in audio has two historical events. ProTools , which was originally Sound Designer and ran on Atari, was bought by Avid and developed for the Mac only. Logic (another Atari original as Creator), ran on Mac and Windows till Apple bought it and effectively threw away 50,000 users who were on Windows. The migration to Cubase in Europe was quite spectacular! Also, with many video formats being developed associated with Mac, it made sense to keep them all joined together. But the industry is not so obviously streamlined now and networking between different systems is not the same headache as previously. So people tend to go for the system they like, or the software runs well on. I am on Windows using Cubase at home (and Nuendo at a studio I am still involved with). But my system is not exactly off the shelf with 64mb ram, 6 core intel and 2 TB of SSDs (plus 6 TB of HD). Then there is additional DSP furnished by other boards and interfaces. It can get quite warm in my office when I have it all running! I don't overclock, by the way (which some home users do) - there is absolutely no need (I have never run out of CPU and Ram) and if I really want to fry an egg I have a nice new Smeg cooker downstairs.1 point
-
To extend Horst here for OSX <advertisement>Sequel Pro</advertisement>1 point
-
1 point
-
Soma, will you be updating to 1.10. any time soon? I know it is in beta and may break some things but there are some very nice changes. I also like their new website btw.1 point
-
NO problem renobird! Yes the parent::init() loads the scripts/styles. So also nothing wrong with doing it manually in your init as alternative. But thanks for bringing this up for sure!1 point
-
Yeah, Congrats! Have seen quite a few new members recently. Would love to hear their stories how they found PW Recent contest? Welcome all!1 point
-
Hey Pete, the problem happens sometimes and not others. I'll reload the page and it works ok, and then reload again and it won't work at all, no matter what speed nor how fast I drag. Not sure if it is related to image not loading in time or what, but definitely not functional when it's mis-behaving. I am sure Joshua will get it sorted out though1 point
-
Adrian - I had the same thing when scrolling too fast one one of the entries in Firefox on Windows - it decided to slide back to the start for some reason. Other than that, great site and unique look - certainly not straining my eyes reading it1 point
-
1 point
-
https://www.google.de/search?q=site:modules.processwire.com+custom+filename+upload EDIT: Oh, shit, it tooks me to long to google it! Adrian was faster!1 point
-
on http://luxcommunications.ca/blog/brand-new-lux-website/ When I look on my desktop 1440x900 the copy font isn't readable. I can't finish one paragraph before loosing it and my eyes get tired. It's too big and very little contrast. Kinda get a upface feeling, maybe also todo with distance from monitor. When I scale in the browser to 2 steps smaller it's already better and I can read it already a lot easier. On the main page http://luxcommunications.ca/ It's all nice and has nice touches! But found it hard to use and the fading at best annoying. For example I scrolled down with mousewheel and suddenly it starts darken - lighten and I don't really get it at first why. Also the "drag" arrows when hovering are a nice touch, so I start dragging and am kinda surprized that there's no inertiam it's kinda sticky and have to drag-drag-drag, personally not that nice. It may would be nicer it it snaps to the next one. After dragging suddenly it scrolls back to the first and I haven't done anything (ah now see, it's when I "mouseout" on the browser window), again wired and annoying. Just my honest feedback from first time observation.1 point
-
Perhaps it needs 2 triggers. 1. if the image in in the center of the screen & if last scroll event is silent for x amount of time trigger darkness 2. if user starts to drag.1 point
-
Joshua you're a great designer & web-developer. Really like what I see. I can see it's designed for big displays as my macbook 13" comes pixels to short. I'm amazed by the performance (FPS) of the web site. I do see why you have the getting dark for the background, but it's activating a little to early to my taste. I think when you activate it when starting the slide is the right time to do it, then you know the guest is interested in that part of the site. Another thing is easy to solve. The browser title telling me that the home page is home (duh ). maybee the companies name is a better browser title.1 point
-
Just published my script on github for setting up Joe Maller's linked 'hub' and 'prime' repos.1 point
-
Awesome! Thanks everyone — your help is very much appreciated. I'll take a shot at creating this module later today and report back.1 point
-
I love how this happens. I run into something that I can't figure out, so I check the forum. Guess what? My question was asked and answered on the same day. Thanks guys.1 point
-
And yes yes yes! The man is cooking on gas!!!! Got it working.... well, so far. Once I finish I will bung together a quick tutorial together because this is a really complicated JQuery plugin (as far as sliders go) and it might be useful for people to know how to weld it together with PW.1 point
-
Good point Adrian. I've added 2.4, and also updated all the modules that are compatible with 2.3 to also indicate compatibility with 2.4. I think this is reasonably safe to assume (I haven't yet found any modules that aren't compatible with 2.4). I made a little bootstrapped script to do it for me… these are always fun ways to feel like you got some work done in 5 mins. include('./index.php'); $v24 = wire('pages')->get('/versions/2.4/'); foreach(wire('pages')->find("pw_versions=/versions/2.3/") as $item) { $item->pw_versions->add($v24); $item->save('pw_versions', array('quiet' => true)); echo $item->title . "<br>"; } If anyone comes across any modules that they find not to be compatible with 2.4, please let me know so that I can update the directory.1 point
-
Jonathan, I need to do the same thing - except for ProcessPageAdd. Any chance you would be willing will to share how you worked this out?1 point
-
Keeping the databases between local develop (laptop) and online production in correct sync is always a pain. Production databases change because of online: 1. visitor interaction with the websites 2. automatic updates 3. blogs 4. automated newsletters 5. guestbooks 6. online subscriptions 7. etc. These changes are not in sync with the local develop database. Because of this I have crashed a few websites in the past when syncing a local database with a production database that was online for a while. Would be good to solve this one day though. Read more here: http://processwire.com/talk/topic/1284-best-practice-for-staging-to-live-database-synchronization/ http://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/1 point
-
I love the idea of getting TinyMCE out of the core and as a module that's installed separately. But the reality is that the marketing folks wouldn't let us do it. They love to be able to say "includes rich text editing!". Lots of people look for this in the features list when evaluating a product and don't bother proceeding if it doesn't include a rich text editor. When people are evaluating products, they don't necessarily know about the module ecosystem and how easily things can be added. Just recently I read someone slamming Drupal because it didn't come with a rich text editor. Obviously that's a silly statement, but perceptions like this matter in growing a product. The other side of it is that providing a really good rich text editing experience means integrating the editor into the system more tightly than most other modules. For instance, our rich text editors (TinyMCE and CKEditor) are integrated into the image and link selection modules. Making sure this all stays working smoothly dictates that it's best kept in the core and upgraded with the core. By this token, I'd like to have CKEditor integrated into the core too, but bundling two rich text editors is probably just too much. As for upgrading to TinyMCE 4, I'd like to do this soon. I had tried to already in the past, and ran into all sorts of issues (they have changed a lot, but it was in beta when I tried it), but this will happen sooner or later. Because of the significant differences, we may have to produce TinyMCE4 as a separate module... or rather keep TinyMCE3 active as a separate non-core module, if we replace the core with TinyMCE 4. That's because the two aren't totally compatible with each other, and anyone that's doing anything complex with their MCE installation may be dependent upon version 3 already. Because switching to TinyMCE 4 is nearly a different rich text editor, we may consider replacing it with CKEditor for our core rich text editor, given that this module is already pretty much in a stable state. Whether the core includes TinyMCE 4 or CKEditor 4, people will have to reconfigure their editors after the upgrade either way. I hate creating upgrade hassles for people, so maybe the best thing to do is just keep TinyMCE 3 where it is in the core and develop other rich text solutions separately. I don't really know, just a whole lot of factors and compromises no matter which direction we go.1 point
-
There's also an API variable (on the admin side) called $breadcrumbs that you can either modify or replace. $breadcrumbs = new Breadcrumbs(); // start with a fresh breadcrumbs list if you want... // $breadcrumbs = wire('breadcrumbs'); // ...or grab the existing copy // then add breadcrumbs to it, here's one example: $breadcrumbs->add(new Breadcrumb($this->config->urls->admin . 'your/path/', "Your Label")); wire('breadcrumbs', $breadcrumbs); // then set it back as an API variable Note that breadcrumbs is just a type of WireArray, so everything from the cheatsheet applies in terms of modifying the contents of it.1 point
-
Just. Don't. Use. It. Seriously: I worked with Joomla exclusively a while ago (around 2004/2005) and the whole concept hasn't changed imho. The main problem is: It is by no means a flexible content management system, it is more a portal system. Let me explain what I mean: Let's say you have a large scale company with 1000 employees. All of those employess have a name, an email, a title and a linked department. You want to display one/several employees on each page in a kind of sidebar. The PW way: - Create a employees template - Add desired fields - Create page field in your other templates for selecting employees - You are then totally free to select employees in your template and you are able to output what you like (HTML, CSS). - You also have the possibility to use that information somewhere else because these are just usual PW fields. - An editor selects the employee(s) where it is needed: While editing the page The Joomla way: - Look if a module exists for that does this job for you (perhaps there is one, but probably not). - even if there is one you have to add your employees in some kind of extra database, where you are tied to the output of the module (not necessarily, perhaps the script kid lets you customize it). - But the biggest problem: Your editor will not be able to select the employees where it is needed. They have to go the modules section in the backend, have to find the module, have to identify the page they want to edit and then have the possibility to select an employee. This is a ridiculous workflow, image you have not only an employee to select but also header images, other side information and so on. The rest of Joomla can be summed up: - Bloated - poor security - inflexible - poor templating Joomla totally is okay for smaller groups, clubs or where ever no technical experience is needed and where the requirements are low. Everyone can set up a site really fast and choose from a lot of plugins (mostly poorly coded though). But when it comes to comfort, flexibility for editors... it is just poor.1 point
-
here's how i setup the custom datatable page: 1.) make a folder in site/templates called admin-custom; inside that i have a css and js folder; in those folders i put all the scripts and stylesheets for datatable (dataTable.css, jquerydataTables.min.js, jquery.uniform.min.js); 2.) make a template in the templates folder, i called it admin-product-table.php; with this code: <table class="table table-bordered" id="dyntable"> <colgroup> <col class="con0" style="align: center; width: 4%" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> <col class="con0" /> <col class="con1" /> </colgroup> <thead> <tr> <th class="head0 nosort"><input type="checkbox" class="checkall" /></th> <th class="head1">Parent Product</th> <th class="head0">Series</th> <th class="head1">Part #</th> <th class="head0">Room Cu. Ft.</th> <th class="head1">Price Ea.</th> <th class="head0">Missing</th> </tr> </thead> <?php $products = $pages->find('template=product-child,sort=title|series'); foreach ($products as $product) { ?> <tr class="gradeX"> <td class="aligncenter"><span class="center"><input type="checkbox" /></span></td> <td> <a href="<?php echo $config->urls->admin; ?>page/edit/?id=<?php echo $product->parent->id ?>" target="_blank"> <?php echo $product->parent->title ?> </a> </td> <td><?php if($product->product_series) {echo $product->product_series;} else {echo 'n/a';} ?></td> <td> <a href="<?php echo $config->urls->admin; ?>page/edit/?id=<?php echo $product->id ?>" target="_blank"> <?php echo $product->title ?> </a> </td> <td> <?php if($product->roomsize_min && $product->roomsize_max) {echo $product->roomsize_min . '-' . $product->roomsize_max;} else echo 'n/a'; ?> </td> <td class="price">$<?php echo $product->product_price; ?></td> <td> <?php if(!$product->speaker_sensitivity) { echo '<span style="color:lime">Sensitivity</span>'; } ?> </td> </tr> <?php } ?> </tbody> </table> <script> $(document).ready(function(){ // dynamic table if(jQuery('#dyntable').length > 0) { jQuery('#dyntable').dataTable({ "sPaginationType": "full_numbers", "aaSortingFixed": [[0,'asc']], "fnDrawCallback": function(oSettings) { jQuery.uniform.update(); } }); } }); </script> 3.) under the Admin page, create a child page called Products, uses template "admin-products" (which will need the ACP_scripts_and_styles field), and uses alternate template filename of admin. Paste the links to the scripts and stylesheets into the ACP_scripts_and_styles field: site/templates/admin-custom/css/dataTables.css site/templates/admin-custom/js/jquery.dataTables.min.js site/templates/admin-custom/js/jquery.uniform.min.js some of how you set this up will depend on which version of PW you are on – see the ACP documentation about that; in my case i have a child page of Products called Products Table which uses the admin-product-table template; hope that's not too confusing; it's pretty simple, but tricky to explain; most of it you can figure out from the ACP documentation..1 point
-
You can't do this just out of the box but with a autoload module you could easily accomplish this. Also there's useful needed features in there for an editor. Why is this a problem? It may not necessary in most cases... In PW, almost all of these things can be changed modified using hooks on what builds them in the admin. So if you really want to do it, the best way would be through a module like the /site/modules/HelloWorld.module It shows some example of hooks and is worth a look and have a play anyway. This following module hides the InputfieldWrapper "Who can access this page"? in the settings tab for user having a role "editor". <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormRoles', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // check what role the user has, if not has editor role do nothing if(!wire("user")->hasRole("editor")) return; // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // we're done } } Create a new file AdminHelperHooks.module with this code in a new folder /site/modules/AdminHelperHooks/ Install and test with editor user.1 point
-
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
-
Well, the admin is built for that purpose to add and edit pages. Every user that has a login is able to see the admin, even if he can't edit anything and if he knows the url. Although you could add hooks to check for roles to redirect out of the admin in case. I didn't say use the module but look at it how it's done, it's also done using API (as everything in PW), so you would need that same codes anyway. I don't see any problems doing your own frontend forms based on a templates fields. But depending on the fields you need, it's not as easy as simply rendering the fields with a form wrapper and you're done (for the reasons mentioned). Jquery UI, inputfields css and scripts and the $config->js would also be needed for them, and some of them would be in the $config->scripts, $config->styles when you render fields on a page. I've never tried to rebuild the backend for the frontend, and always try to use some shortcut link on the pages for them to edit or create pages using a simple link with url to the right admin screen. If I combine that with &modal=1 and fancybox modal they don't even need to go to the backend. <a class="fancybox" href="/processwire/page/edit/?id=1123&modal=1">edit page</a> <a class="fancybox" href="/processwire/page/add/?parent_id=1022&modal=1">add page</a> That's in cases sufficient to give a simple frontend editing capability with 2-3 lines of code.1 point