Leaderboard
Popular Content
Showing content with the highest reputation on 04/25/2013 in all areas
-
Sorry it's been a while since I last updated you guys on this theme. I was moving house when I started this theme and then I didn't have the internet for a few weeks and then I was ill. lol. But I'm all better now and I've continued developing this theme. Before you see the new screenshots of it's progress I just want to share what I found while developing this theme. I found the markup for the admin theme a bit messy. Styling all the fieldsets for example was quite a challenge because some fieldsets are within fieldsets and so you end up with this doubling up effect. As I started to discover more of the admin theme I realised there are a lot of user experience issues and some fieldsets can be quite heavy. Once I've finished this theme I would very much like to offer my help in suggestions for improving the overal experience of the admin. So I took all my learning into consideration and tried to think of the best way to develop a theme that I could build and suited ProcessWire's current way of presenting information; which so far has led me to this approach. I haven't included the header or footers in these screenshots because I'm still playing around with it. Example of editing Guest role: Example of editing Admin user: Example of editing Field module: As you can see it's changed quite a bit, but I'm feeling a lot more confident about where I want to go with this theme. I'll keep you guys updated in the following weeks as to when I'll release an alpha version of it so you guys can help me find any quirky bugs with it. Thanks for listening.5 points
-
In a rare display of personal work I’ve made a photographic site to show some of my pics. I hope you like it. http://stlmv.in/mw2 points
-
It's not always good practice to have default value set for various reasons and there's some discussion about it in the forums. You have "normal" .. is it really needed to have that as a selectable state? All default entries are "normal" and should be handled in template code. Just create option with dropdown (as radios have no blank) and have "important" and "very important" as states.2 points
-
Here is a new module for ProcessWire 2.1 that imports pages from a CSV file. By default it will create new pages from data in the CSV file, but you can also configure it to modify existing pages too (existing pages that have the same title). Please give it a try and let me know how it works for you and if you run into any issues with it. This module is something I've had in the works for awhile, and regularly use on various projects, so figured I should clean it up a bit and release it. Also attached are a couple screenshots from it. How to Install: 1. Download from: https://github.com/r.../ImportPagesCSV 2. Place the file ImportPagesCSV.module in your /site/modules/ directory. 3. In ProcessWire admin, click to 'Modules' and 'Check for new modules'. 4. Click 'install' next to the 'Import Pages CSV' module (under heading 'Import'). Following that, you'll see a new menu option for this module on your Admin > Setup menu. Supported field types for importing:* PageTitle Text Textarea (including normal or TinyMCE) Integer Float Email URL Checkbox (single) *I'll be adding support for multi-value, page-reference and file-based Fieldtypes in a future version.1 point
-
Hi everyone! With Batcher you can batch-edit and create Pages in the Pw Admin. If you install this module, you get a new Page "Batcher" under Setup. Modules page: http://modules.processwire.com/modules/process-batcher/ Github: https://github.com/wanze/ProcessBatcher Editing How does it work? Search your pages with a selector. You can check if you want to include also hidden/unpublished pages with the filters. Select the pages you want to execute an action (the action only gets executed on "checked" pages). Select the action and if necessary, additional data like the new parent or the new template. Execute. Supported actions: Publish/Unpublish Pages Hide/Unhide Pages Lock/Unlock Pages Trash Pages Delete Pages Change Parent Change Template Batcher does the following permission checkings for the current user: Don't display pages that are not editable Remove Actions if the user doesn't have the permissions (page-delete, page-move, page-template, page-lock) Important notes: When changing a template, data in fields of the old template which are not assigned to the new template gets deleted. When changing the parent, the template of the new parent must accept the pages template as children. This is a setting in the template under "family". Creating How does it work? Select a parent where your new pages will be added as children Add as many pages as you want by clicking "add Page" Click "Create Pages" You must enter a title and choose a template. The name is optional: If left empty, Pw will generate this for you. Includes permission checking and Family template restrictions. This means in detail: The selected parent must accept children and their template The pages template must accept the parents template User needs the permission to add children to the selected parents template User needs the permission to create Pages for the chosen Template Batch-creating tips The chosen template and the statuses are always cloned from the last row. So if you need to add 30 pages with the same template, define it first and the click "add Page" - it'll make your life easier ;-) You can drag & drop the table rows should you want to change the order. The dragging looks ugly but it works. For the lazy dogs and keybord hackers among us, you can add a new row by pressing "ctrl+n". This works (at least in firefox) only if no input has focus. After adding a new row, the title input gets the focus. By pressing 3 times tab you arrive at the published-checkbox, here the short-cut works. Restrict Batcher for a user to only allow editing or creating Create permissions "batcher-edit" and/or "batcher-add". As soon those exists, the module checks if the current user has the permissions. If you only need batch creating, check out the following module by Soma: http://processwire.com/talk/topic/2138-process-tools-create-pages-wip/ Cheers1 point
-
Captain Hook ProcessWire Hooks Cheatsheet http://somatonic.github.com/Captain-Hook/ or on processwire.com http://processwire.com/api/hooks/ I created a simple list with a live search for all hookable methods available in the core. All methods prefixed with a "___" (3 underscores) are hookable. Methods can be made hookable by simply adding those ___ to it. ------------------------- I usually don't really need this, but thought it would be good to have an official list for reference. I used Sublime Text2 for searching and dumb a file with a search for " ___" in wire core. From this list I created a html file with a php script and added some fuzzy live search, similar to the API cheatsheet. If you use Sublime Text 2 like me you can simple use Goto Anything command super+p to show a fuzzy search for files. Enter a class name you want to search for. For example "fields" or "process page edit" you will recieve a list of files found in PW. Highlight the file and typ a @ to see the symbol list quickly or select the file and super+r the get the symbol list.1 point
-
AdminSaveActions (Was: After Save Actions - guess why the rename?) Admin Save Actions adds the possibility to choose where the browser gets redirected after saving a page, template or field. Admin save actions are displayed just before the save button in a collapsed container. Chosen action can be saved in a cookie for current user by checking "Remember this setting". By leaving this option unchecked upon save, the chosen action will not become the default. Why? Some of you wanted something like this to exists in ProcessWire - and so did I. I've read discussions here, here, here and here carefully trying to cover at least most of the options discussed. I know this implementation wont satisfy all the needs, but I'm looking into adding some things afterwards to cover even more of them. I called the first version of this module PageEditRedirects but decided to to change the name in to a more descriptive one. So that module got deprecated as of now (and does not exists at GitHub anymore). This new version also does not require PW 2.3 but works just fine on PW 2.2 as well. Special thanks A module by Adam Kiss (ListAfterSave) implemented some of these actions a long time ago. Thanks to Adam for letting me use the ideas introduced by his module. There are actually some things there my module isn't going to cover even in future versions. Links AdminSaveActions can be found from the modules section. AdminSaveAction is downloadable from GitHub. (Edit: added link to the modules section. Edit 2: Implemented config option + version bump. Edit 3: Removed feature list - see GitHub.)1 point
-
Flourish for ProcessWire v0.9.0 ProcessWire wrapper around the great http://flourishlib.com'>unframework Flourish. This module has the same version as the framework, so whenever update happens, your http://modules.processwire.com/modules/modules-manager/'>Modules Manager will pick up new version and update the framework to latest version (if you're into that!). Happy hacking. Note: You should checkout the short module's code to see what I consider to be the cleanest approach on how to include other libraries/frameworks into your PW websites. Github: https://github.com/adamkiss/LibFlourish Modules directory: http://modules.processwire.com/modules/lib-flourish/1 point
-
thanks kongondo... must have somehow missed that; this is actually perfect – the %= works great, and this is a small site. Speed is fine with this...1 point
-
This also from the API docs.... http://processwire.com/api/selectors/1 point
-
Hey, is this new? Cool: mods.pw/3y EDIT: uhm, sorry for beeing OT! Just got excited.1 point
-
I think this is to with the way MySQL is searched and I believe you can change the minimum word length in your server settings. Not sure if this will affect PW's use of search though. Edit: You'll also note for example that three-letter words are excluded on this forum.1 point
-
massage and error for admin no ? use them like this u can two $pages->error('bad man'); $session->message('hi'); wire('pages')->error('bad bad.man'); wire('session')->message('hiho'); work.for any api vrable it does1 point
-
... no answer. I decided to help myself and hope somebody else will profit from it. I changed the following lines (450 ff) in the module-file from: if ($this->user->avatar) { $cropped_avatar = $this->user->avatar->first()->size(150); $avatar = $cropped_avatar->url; } to: if ($this->user->avatar->first()->url) { $cropped_avatar = $this->user->avatar->first()->size(150); $avatar = $cropped_avatar->url; } Now its working. About security: After logging-in each user can reach every profile about other users via profile/info/username. I think I will make some modifications for my personal use in this line (481): if($this->user->isLoggedin() && $this->input->urlSegment1 == 'info' && $this->sanitizer->name($this->input->urlSegment2)) { I would also recommend to include a field which inquires the old password before giving the allowence to set a new one in the edit-area. Until going deeper in PW I like it more and more and can image how big the potential for the future is. kixe1 point
-
Hi kongondo, There's no reason to use a while loop in the situation where you are just iterating over the pages found. Generally: If you need to loop over a set of data, you're free to choose the type of loop (for, while, do-while). However, it depends on the situation which one you take As for your example, you could do it in a while loop like this: $i = 0; while (count($results)) { $p = $results->get($i); $rows[] = $p; $results->remove($i); $i++; }1 point
-
while(youcan < youshould) { // do what you want } Well use foreach... It's just a matter of preference and you could even use for() foreach() while() A while loop with a PageArray would look like this: $res = $pages->find("template=somexy, limit=10"); $i = 0; while($r = $res->eq($i)){ echo $r->title . "<br/>"; $i++; }1 point
-
Hi Lenoir, I think this has come up a few times and I don't think there is a way of setting a default in the admin side. What you can do however is use if/else statements in the template: if ($page->field == "very_important") { // do something } elseif ($page->field == "important") { // do something different } else { // user has either selected normal or left it blank so use normal }1 point
-
Thanks @thistimj & @diogo. That shot was a fluke. I stuck my phone against the window the night before they put up barriers and pulled the building down. @horst: you might like this one too. Regards Marty1 point
-
There are probably lots of ways to include common content, but the naming convention of "head" and "foot" made this particular approach a bit confusing for me as a newbie. Saying the template files don't have anything to do with ProcessWire doesn't remove the naming association with HTML tags or standard header/footer template blocks. I'm looking forward to learning about other approaches to resolving the common content problem. Thanks for all the good comments and help. Rick1 point
-
If you want to integrate Google+ Comments in your ProcessWire website, just follow the instructions from an article on Browsing the Net. In summary, insert the following HTML code into your template: <script src="https://apis.google.com/js/plusone.js"></script> <g:comments href="<?=$page->httpUrl?>" width="642" first_party_property="BLOGGER" view_type="FILTERED_POSTMOD"></g:comments> Change the width accordingly and in case you have a Google+ profile, link your page with Google+ profile to enable moderation features.1 point
-
Good question. This is one of those "one man's meat is another man's poison" sort of situation. There are so many different approaches to doing your template files...No one approach is superior (in most cases ) to another. It is an issue of preference. You can even decide you want all your HTML code with PHP inside in one file. This can result in very long, hard-to-grasp code though. You can decide not to name your includes as .inc but .tpl..PHP will happily include them when asked to do so....Or, you can have as many .inc as you wish to make your head spin trying to guess what is including what . I hope it doesn't confuse you more but have a look at this thread. It has lots of wonderful ideas about approaching your template files. Having .inc files also helps with dynamism. For instance, your website can have the same header throughout but different footers depending on the page being viewed. There can be a sidebar.inc as well, which will only appear in certain pages and show a sub-menu, a featured article, etc.... I am working on a short tutorial part of which I hope to post here soon...(and on my website whenever that materialises ) about visualizing your site structure before you build it. Planning is important in these things. Again, people have different approaches. I like to think diagrammatically, at the whole system level. Such an approach helps me visualise the template approach to adopt for a particular job. For instance, what areas of the website are common/shared? What is unique to some pages? How best can I code/design/plan my templates and template files to achieve what I want making best use of logic, KISS and DRY principles and balancing this against common sense and ease of understanding the code? If I come back to the code in a month's time, or if somebody took over my task, would I/they be able to make sense of it all? Sorry for digressing somewhat1 point
-
1 point
-
The problem is scalability. Putting them on top wil give performance issues as it has to reassign the index for all siblings.1 point
-
That's correct. When PW 2.4 is here, it won't matter, because PW will require PHP 5.3+ as well. But this could be a recurring issue with PHP 5.4, 5.5, etc. I recommend that any modules available on the modules directory be required to have the same PHP version requirements as the version of PW they are written for. An autoload module that requires PHP 5.3 when they only have PHP 5.2 could take down someone's site.1 point
-
1 point
-
If you want you can create a bootstrap, or in a template, and use API to change all TinyMCE fields settings. Example: include('./index.php'); $fields = wire("fields")->find("name*=tinymce_"); foreach($fields as $field) { $field->theme_advanced_buttons3 = "table|bold"; $field->custom = "theme:advanced"; $field->thirdparty = "bramus: /site/tinymce/bramus_cssextras"; $field->save(); }1 point
-
First of all, you'll get more descriptive error messages by turning debug mode on in /site/config.php. It's very useful while developing, but you shouldn't keep it on after a site has been made public -- in error situations like this it'll output way more information than you really want visitors to see. Problem here seems to be that you're using PDO commands while what you should be using are mysqli ones with $db->query(), since it actually utilizes mysqli under the hood. More information about this can be found here: http://dev.mysql.com....choosing.html. Another (minor) problem is that you're using event as a constant at that last row (that $rows[0][event] should be $rows[0]['event'].) With following changes your code should work properly. Note that I've also added extra check to the end of the script to make sure that some events are actually found. Originally you were only checking if a mysqli_result object was returned.. which doesn't necessarily mean that any data was found $day = date('d'); $month = date('m'); $table = "timetable"; $rows= array(); $results= $db->query("SELECT event,time,location FROM $table WHERE day = '$day' AND month = '$month' ORDER BY month ASC"); if ($results) { // loop through the result set and inspect one row at a time while ($row = $results->fetch_array()) { array_push($rows, $row); } } if (count($rows)) { $event = $rows[0]['event']; } else { // no data found. you might want to add some kind of error message here. } ...1 point
-
For something like that, I think you'll be better off just importing from the API. Probably 70% of the time that I need to do any kind of importing of anything, I just use the API because it usually makes a quick and easy job of it, without having to consider any limitations. But if you want to get image/file descriptions in with the CSV import module, then I would probably create a temporary field to store them in, for import purposes. Then go back and paste a little code in a template to quickly convert them over: foreach($mypages as $p) { $p->of(false); $p->image->description = $p->temp; $p->save(); } Once you've done that, you could then go and delete that 'temp' field from the template.1 point
-
person, do this.you can: $pages->find("template=artwork, sort=artistpage.sort");1 point
-
Jasper, I didn't want to leave you empty handed, especially after you've tried this a few times and my suggestions didn't work. Here's an updated version of the ImportPagesCSV module that supports file and image filed importing. It supports both single and multi-file fields, so there aren't any limitations in that area. https://github.com/ryancramerdesign/ImportPagesCSV To import a multi-file field, place each filename or URL on it's own line in your spreadsheet, OR separate each by a pipe "|", OR separate each by a tab (you decide) – basically, you are delimiting the filenames/URLs within the field. In my own tests, I used the pipe "|" to separate the URLs and all seemed to work well. Of course, if there is only one image/file, you don't need anything other than the filename or URL (no delimiter necessary). I ended up changing quite a bit of code, so please let me know if you run into any error messages or anything – it may not be perfect yet, but hopefully close.1 point
-
MIGRATING A SITE FROM DEV TO LIVE FOR THE FIRST TIME STEP 1: Copy all the files from dev to live Copy all the files from your dev installation to the live installation. Whether you use FTP, rsync, scp or some other tool doesn't matter. What does matter is that you copy everything and that you retain the file permissions–More specifically, make sure that /site/assets/ and everything in it is writable to the web server. Here are some sample commands that would do it (replace 'local-www' and 'remote-www' with your own directories): Using rsync: rsync --archive --rsh=/usr/bin/ssh --verbose /local-www/* user@somehost.com:remote-www/ Using scp: scp -r -p /local-www/* user@somehost.com:remote-www/ Using FTP/SFTP/FTPS: I think this will depend on the FTP client that you are using as to whether it will retain the permissions of the files you transfer. Hopefully it will do that by default, if not, check if there is a setting you can enable. If not, then you may have to adjust the permissions manually in /site/assets/ and the dirs/files in there. Make sure /.htaccess got copied over too Depending on how you copied the files in step 1, it may or may not have included the /.htaccess file. Make sure that gets copied over, as many copying tools will ignore hidden files by default. STEP 2: Transfer the MySQL Database from Dev to Live a. Export dev database Export ProcessWire's database on your development server to a MySQL dump file. PhpMyAdmin or mysqldump are the most common ways to do it. Personally I use PhpMyAdmin because it's so simple, but here is how you would do it with mysqldump: mysqldump -u[db_user] -p[db_pass] [db_name] > site.sql b. Create live database Create a new MySQL database and database user on the live server and make note of the DB name, DB host, DB user and DB pass, as you'll need them. c. Import dev database to live Import the MySQL dump file you exported from your dev server. Most web hosts have PhpMyAdmin, so that's what I use to import. If you have SSH access, you can also import with the mysql command line client, i.e. mysql -u[db_user] -p[db_pass] -h[db_host] [db_name] < site.sql d. Update /site/config.php On the live server, edit the /site/config.php file. At the bottom you will see the database settings. Update these settings to be consistent with the database/user you created, then save. Most likely you will only be updating these settings: $config->db_name = "database name"; $config->db_user = "database user name"; $config->db_pass = "database user password"; $config->db_host = "database host, most commonly localhost"; STEP 3: Test the Site Your site should now be functional when you load it in your browser. If not, then enable debug mode: a. Turn on debug mode (only if you get an error) Edit /site/config.php and look for $config->debug = false, and change it to $config->debug = true. Then load the site in your browser again and it should give you more details about what error occurred. If you aren't able to resolve it, contact Ryan. b. Browse the site Assuming your site is now functional, browse the site and the admin and make sure that everything looks as it should. If it looks like stylesheets aren't loading or images are missing, it may be displaying cached versions from your dev site. If that's the case, you need to clear your cache: c. Clear your cache (optional) Login to the ProcessWire admin and go to Modules > Page Render > and then check the box to "clear page render disk cache", then click save. This should resolve any display issues with the site's pages. d. Practice good housekeeping Make sure that you've removed /install.php and /site/install/, and check to make sure that /site/config.php is not writable. While this isn't absolutely necessary, it's good insurance.1 point