Leaderboard
Popular Content
Showing content with the highest reputation on 05/27/2015 in all areas
-
Hello ProcessWire-Community, I would like to share with you an website I made with ProcessWire for the agency designconcepts, for which I am currently working for. The website is for the interior decoration company von Bergh and is a single page. Although it has very much content to offer through some flexible sections. On top of the website is an classic image slider, which changes the parallax background of the site, depending on which image currently is displayed. The news section is an accordion element inside an tab element, so that it could have multiple news pages. The reference section is an isotope element, which can be sorted and the active reference is loaded with AJAX into an stage container. The company section and footer are tab elements, but the footer is hidden on page load and expands by clicking on the navigation. Further is the website translated into two languages, responsive, optimized for better performance (for example through LazyLoad and Responsive Images). At last here is a short list of modules I used: Template Twig Replace Images with cropping MinifyHTML Trashman Schedule Pages I really hope you enjoy this website and maybe I will post some more, because I am a great fan of the ProcessWire CMS. Best regards, Andreas5 points
-
This is becoming more and more impressive and useful with each update! Great stuff. On of my most used modules.4 points
-
Sorry for all the quick updates, but am using this to populate a huge site and finding new needs so implementing as I go. You can now change the template of each child page in the Edit mode. Because this change happens without warnings, it is controlled by the new "Allow template changes" setting in the module config. Of course the ability to change templates is also additionally controlled by the user's "page-template" permission. Note - you might potentially only want to enable "Allow template changes" while your site is in development and disable once it is live to avoid any disasters. TIP: If you want to change the template for all child pages at once and there are lots of pages, this could still be a little tedious. So instead, use the "Replace" mode, choose the "Child Template" at the top and click Save. This will delete and recreate all child pages with the selected template. This is super fast if the pages don't have any content yet (or child pages of their own), which can often be the case early in development when you are still figuring out which pages will have which templates!3 points
-
Another major new feature! I have added an Export to CSV mode which generates a CSV file containing the fields for all child pages. It currently supports most field types, including: Text/Textarea/Integer/Date fields Page fields - exports the "Title" if available, or "Name" if not (eg user template), rather than just the page ID File/Images - exports the filenames Profields Textareas - automatically converts field into multiple columns - one for each subfield Profields Multiplier - separates values with a customizable separator - you can choose a line break if you want which is nice when opening the CSV in Excel. This same customizable separator is available for other multiple fields like Page fields, File/Image etc It does not support Profields Table, PageTable or Repeaters as these would get very messy. Note if you want to provide an export for specific Table fields, don't forget to check out: Table CSV Import/Export Fields to be exported can be predefined or customized by the user. Also includes an API export method: //export as CSV if csv_export=1 is in url if($input->get->csv_export==1){ $modules->get('ProcessChildrenCsvExport'); //load helper module //delimiter, enclosure, file extension, names in first row, multiple field separator, array of field names $page->exportCsv(',', '"', 'csv', true, "\r", array('title','images','textarea_test')); //$page->exportCsv() - this version uses the defaults from the module or page specific settings } // display content of template with link to same page with appended csv_export=1 else{ include("./head.inc"); echo "<a href='./?csv_export=1'>Export Table as CSV</a>"; //link to initiate export include("./foot.inc"); } Like the rest of this module, everything is configurable at various levels, so you can include this functionality as a separate tab, or part of the Children tab. You can predefine all settings so the user only has a simple Export button - whatever works best for you. Please let me know how this new functionality works out for you and if you have any suggestions for improvements.3 points
-
2 points
-
It's almost impossible to do updates to a high frequent live site without downtime. At least not with common setup php mysql. We have a project that has always user on the site browsing, ordering, commenting etc. Every time I even just upload a global template or script/module, there happen to be at least 4-5 errors in that 0,5 sec uploading it. I've been thinking a lot about how to fix that but it's simply not possible. Best is still, even for very small updates, to shut the site for maintenance to make sure there's nothing fancy happening.2 points
-
@cstevensjr thanks for your answer, it point me to the right direction. The problem is in old version of smtp class: Certificate is issued to hostname, but smtp class sends IP. In the last version it was fixed and works fine for me now on php5.6. @horst, update smtp class, please. http://www.phpclasses.org/package/14-PHP-Sends-e-mail-messages-via-SMTP-protocol.html2 points
-
This module facilitates quick batch creation (titles only or CSV import for other fields), editing, sorting, deletion, and CSV export of all children under a given page. You can even provide an alternate parent page which allows for editing of an external page tree. http://modules.processwire.com/modules/batch-child-editor/ https://github.com/adrianbj/BatchChildEditor The interface can be added to the Children Tab, or in a new dedicated tab, or placed inline with other fields in the Content tab. Various modes allow you to: Lister - Embeds a customized Lister interface. Installation of ListerPro will allow inline ajax editing of displayed fields. Edit - This allows you to rename existing child pages and add new child pages. It is non-destructive and so could be used on child pages that have their own children or other content fields (not just title). It includes the ability to quickly sort and delete pages and change page templates. Also allows full editing of each page via a modal dialog by clicking on the page name link. This is my preferred default setup - see how it replaces the default Children/Subpages with an easily addable/editable/sortable/renamable/deletable list. Note that the edit links open each child page in a modal for quick editing of all fields. Add - adds newly entered page titles as child pages to the list of existing siblings. You could create a list of pages in Word or whatever and just paste them in here and viola! This screenshot shows the editor in its own tab (name is configurable) and shows some of the CSV creation options. Update and Replace modes look fairly similar but show existing page titles. Update - Updates the titles (and any other fields if you enter CSV data) for the existing pages and adds any additionally entered pages. Replace - Works similarly to Add, but replaces all the existing children. There are checks that prevent this method working if there are any child pages with their own children or other content fields that are not empty. This check can be disabled in the module config settings, but please be very careful with this. Export to CSV - Generates a CSV file containing the fields for all child pages. Fields to be exported can to fixed or customizable by the user. Also includes an API export method. Populating fields on new pages In Add, Update, and Replace modes you can enter CSV formatted rows to populate all text/numeric fields, making for an extremely quick way of creating new pages and populating their content fields. Predefined Field Pairings Like the field connections setup from Ryan's CSV Importer, but defined ahead of time so the dev controls what columns from the CSV pair with which PW fields. This is especially powerful in Update mode giving editors the ability to periodically import a CSV file to update only certain fields on a entire set of child pages. These pairings also allow for importing fieldtypes with subfields - verified to work for Profields Textareas and MapMarker fields, but I think should work for most others as well - let me know if you find any that don't work. Access permission This module requires a new permission: "batch-child-editor". This permission is created automatically on install and is added to the superuser role, but it is up to the developer to add the permission to other roles as required. Config Settings This module is HIGHLY configurable down to setting up custom descriptions and notes for your editors. You define one config globally for the site and then optionally you can define completely custom configurations for each page tree parent on your site. There are too many settings to bother showing here - you really just need to look through all the options and play around with them!1 point
-
I exported a CSV file from freebase.com that contained all the skyscraper fields I wanted to use. Then I created a simple shell script to import it from the CSV. Note that I only used a shell script for convenience, you could just as easily do this from a ProcessWire template file if you preferred it or needed to do this from Windows, etc. Below is a simplified example of how to do this. The example is fictional and doesn't line up with the actual structure of the skyscrapers site, nor does it attempt to create page relations or import images. If you are interested in how to do that, let me know and I'll keep expanding on the example in this thread. But I wanted to keep it fairly simple to start. First, here is the contents of a CSV file with each line having a skyscraper building name, city, and height. /skyscrapers/skyscrapers.csv (Building, City, Height): Sears Tower, Chicago, 1400 John Hancock Tower, Chicago, 1210 Empire State Building, New York City, 1100 IBM Building, Atlanta, 860 Westin Peachtree, Atlanta, 790 Next, create a new template in ProcessWire and call it "skyscraper". Create a text field for "city", and an integer field for "height" and add them to the skyscraper template. Create a page called "/skyscrapers/" in ProcessWire, that will serve as the parent page for the skyscrapers we'll be adding. Here is the command-line script to load the ProcessWire API, read the CSV data, and create the pages. As I mentioned above, this could just as easily be done from a template, where the only difference would be that you wouldn't need the shebang (#!/usr/local/bin/php -q) at the beginning, nor would you need to include ProcessWire's index.php file. /skyscrapers/import_skyscrapers.sh: #!/usr/local/bin/php -q <?php // include ProcessWire's index file for API access // (this isn't necessary if you are doing this from a template file) include("./index.php"); $fp = fopen("./skyscrapers.csv", "r"); $template = wire('templates')->get("skyscraper"); $parent = wire('pages')->get("/skyscrapers/"); while(($data = fgetcsv($fp)) !== FALSE) { // create the page and set template and parent $skyscraper = new Page(); $skyscraper->template = $template; $skyscraper->parent = $parent; // set the skyscraper fields from the CSV list($building, $city, $height) = $data; $skyscraper->title = $building; $skyscraper->city = $city; $skyscraper->height = $height; // set the URL name, i.e. Sears Tower becomes "sears-tower" automatically $skyscraper->name = $building; // save the skyscraper $skyscraper->save(); echo "Created skyscraper: {$skyscraper->url}\n"; } To do the import, make the script executable and then run it from the command line: chmod +x .import_skyscrapers.sh ./import_skyscrapers.sh OR, if you are doing this from a template file, then load the page (that is using this template) in your web browser, and that will execute it. The output should be: Created skyscraper: /skyscrapers/sears-tower/ Created skyscraper: /skyscrapers/john-hancock-tower/ Created skyscraper: /skyscrapers/empire-state-building/ Created skyscraper: /skyscrapers/ibm-building/ Created skyscraper: /skyscrapers/westin-peachtree/ If you go into the ProcessWire admin, you should see your skyscrapers. I used an example of CSV file for simplicity, but the same method applies regardless of where you are pulling the data from (web service feeds, etc). For the actual skyscrapers demo site, I used Freebase's web services feed to pull the data and images, etc.1 point
-
Okay, I finally found the cause of it all. During one of the last few days, I must have changed the Access level for the child pages, which in turn prevented me from searching them, when not logged in. This works. wire('pages')->count("parent=/case-references/, check_access=0"); Thank you everyone for helping me!1 point
-
The method get() returns only one page. Your code is looking for a page with the path /case-references/. If this path doesn’t exist on your site, you will get a NullPage. You can check if you got a NullPage by testing for $references_parent->id === 0 or $references_parent instanceof NullPage. Because you only get a single page from get(), your variable $num will always be 0, as page objects don’t have a count. To find multiple pages, you should use wire('pages')->find(). Unfortunately it is unclear which pages you want exactly. I’m guessing you want all the children of /case-references/. In that case, try wire('pages')->find('parent=/case-references/'). You may also want to specify the template of the pages you’re looking for. Also in your first line you are testing whether $page->id is false AND $page is unpublished. That seems like an unlikely combination, because the NullPage is usually published.1 point
-
There is no need to get/find the pages, just use count: $num = wire('pages')->count("parent=/case-references/");1 point
-
Google has killed off one of their pre-oAuth authentication methods, and the popular GAPI library is still relying on it. In case that anyone here happens to use said library for communicating with Google Analytics, please make sure that you're not running it in an environment where errors are publicly displayed. This is especially important if the GAPI authentication request isn't properly wrapped with try..catch, since the stack trace will contain Google credentials as-is, i.e. unencoded and publicly visible. Just a word of warning, since currently a simple Google search will result in a whole lot of sites with exactly this issue, and with plain-text credentials (partly or completely) visible.1 point
-
Feel free to support my request for it here: https://github.com/ryancramerdesign/ProcessWire/issues/932. I could try to implement this in the module, but I'd rather not do it. If Ryan implements it, then other inputfields can be compatible, too.1 point
-
Some cross-linking and gratuitous self promotion I have just implemented highly configurable CSV exporting (admin and API) into Batch Child Editor: https://processwire.com/talk/topic/6102-batch-child-editor/page-2#entry95855 It does lots of work for you, including supporting ProFields Textareas and Multiplier, along with outputting Page field title/name, rather than ID. Export settings can be configured by the developer and/or the site editors. It might be useful for others searching for CSV export and finding this thread.1 point
-
Here is the updated PageimageRemoveVariations module with the exclude list: PageimageRemoveVariations.zip I went with exclude list instead of include list to make it backward compatible. I think making exclude/include feature configurable would unnecessarily overcomplicate things. I've also added myself to the author field not to blame horst if the excludeList goes fatal1 point
-
They now are offering to install PW from the admin interface of your webspace: https://twitter.com/domainfactory/status/603131328826101760 (Fun fact: Almost all of our PW installations run there as we usually recommend DF as our preferred hosting company)1 point
-
I had a similar situation a couple of months ago when I tried to upgrade my domains to PHP 5.6.x on my web host. I never resolved this issue and ended up reverting to PHP 5.5.x Note: The following is what I found out by using Goggle search. It may apply or not apply to your situation, however I hope that maybe it will cause others to chime in on possible solutions All encrypted client streams now enable peer verification by default. By default, this will use OpenSSL's default CA bundle to verify the peer certificate. In most cases, no changes will need to be made to communicate with servers with valid SSL certificates, as distributors generally configure OpenSSL to use known good CA bundles. - OpenSSL changes in PHP 5.6.x (PHP Manual) It appears that in PHP 5.6.0 (at least the version in Debian jessie, with openssl 1.0.1h-3), this function is now validating SSL certificates (in a variety of ways). First, it appears to fail for untrusted certificates (i.e. no matching CA trusted locally), and secondly, it appears to fail for mismatched hostnames in the request and certificate. "PHP 5.6 now verifies SSL certificates, the "fsockopen" function fails in the "ConnectToHost" method due to mismatched certificate CN (expects host name, but IP is given instead)." -Klemen (PHP 5.6 compatibility) The problem is that this change is resulting in an error on Email Class SMTP protocol: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed When you update to PHP 5.6+ the "CA Root" have to be set, or OpenSSL certificate verify don't work correctly. Step One: Install CA_Root (In my case, on FreeBSD 10, via Ports) /usr/ports/security/ca_root_nss After install, the Pem Cert will be located at: /usr/local/etc/ssl/cert.pem Step Two: Add to php.ini the openssl.cafile openssl.cafile = /usr/local/etc/ssl/cert.pem Restart your HTTP Server, and verify with phpinfo() References: http://stackoverflow.com/questions/27622427/codeigniter-2x-email-class-smtp-ssl-verification-bug-on-php-5-6 http://www.phpclasses.org/discuss/package/14/thread/78/ http://php.net/manual/en/migration56.openssl.php1 point
-
1 point
-
feel free to share/use it. created with free picture of http://pixabay.com/en/ and (partly) free editor https://www.canva.com/1 point
-
I'm due a trip to London this summer. Nothing set yet but I'd love too to meet other PW users and have a beer.1 point
-
1 point
-
https://www.maletschek.at It's online now for quite a time and my biggest PW-project so far. It has loads of content (sitemap) and the editors are loving how easy it is to manage - client quote: "it's a quantum leap forward" edit: screencast added here: https://processwire.com/talk/topic/10006-maletschek-nautics-boat-center-at-neusiedlersee-in-austria/?p=95531 Highlights shortcut edit-links almost everywhere on frontend with a single line of code in the template file (planning to release a module for this one day i find the time... or if anyone is interested in doing this i can share the code i have so far) and showing what part of the site is going to be edited on mouse hover point of contact for every section - option to inherit it to the whole sub-branch of the tree for example "jakob" is point of contact for boats and he will by default also be POC for every single boat posted in this section. if there is a different POC for one single page in this branch (eg /boats/small-boats/) that's also possible by checking the checkbox - so all boats on sub-pages (/boats/small-boats/boat1) will again have jakob as POC Caching with custom Cache Reset Module (necessary due to the previous point in the list) at least for me that's a highlight because that was the first time i needed to hook something... https://processwire.com/talk/topic/8997-clear-cache-for-all-children/ widget system with complete control of where to display the widget: in this example the "point of contact" widget is shown an all pages ( site "/" - "show" - "also on subpages" ) except section "blog" ( site "blog" - "dont show" - "also on subpages" ) yumpu online catalog textformatter module like on this page: https://www.maletschek.at/shop/bootszubehor/pfeiffer/ see forum thread here: https://processwire.com/talk/topic/9888-textformatter-yumpu-embed/ i hope you like it and i'm looking forward to hearing your feedback and of course thank you all for your help! ps: sorry, there's only a german version of the website1 point
-
here you go: it's very simple, yet extremely comfortable for clients. you just need one simple javascript function: function editLink($pageid) { if(wire('pages')->get($pageid)->editable()) { // add page if action == add // check permission first! ob_start(); $editid = "editlink_" . uniqid(); ?> <div style="position: relative;" class="editlink" id="<?= $editid ?>"> <div style="position: absolute; right: 0; top: 0; z-index: 100;" class="uk-text-right"> <a href="/admin/page/edit/?id=<?= $pageid ?>&modal=0" target="_blank" class="uk-button uk-button-primary editmodal" style="color: white;"> <i class="uk-icon-edit"></i> edit </a> <?php // next floating button here ?> </div> </div> <script type="text/javascript"> $(document).ready(function() { $("#<?= $editid ?>").parent().addClass("editlinkparent"); // paddings must be adjusted when window is resized $(window).on("load resize", function () { // remove top and right margin var paddingright = $("#<?= $editid ?>").parent().css("padding-right"); var paddingtop = $("#<?= $editid ?>").parent().css("padding-top"); //$("#<?= $editid ?>:first-child").css("border", "1px solid blue"); $("#<?= $editid ?>:first-child").css("right", "-" + paddingright); $("#<?= $editid ?>:first-child").css("top", "-" + paddingtop); }); // colorbox /*$(".editmodal").colorbox({ iframe:true, width:"90%", height:"90%", onClosed: function() { location.reload(); }, });*/ }); </script> <?php return ob_get_clean(); } else return false; } and little CSS: // edit link .editlink {display: none;} .editlinkparent:hover {outline: 3px solid #ddd;} .editlinkparent:hover > .editlink {display: block;} note that i'm using markup for UIKIT css framework. what it does: let's say you have a blog-template showing all the children as postings. all you need to do when you want them to be editable on mousehover would be this: <?= editlink($page->id); ?> <section class="uk-grid uk-margin-left uk-margin-right uk-margin-large-top"> <div class="uk-width-large-3-4"> [...] <?php foreach($posts as $post): ?> <div class="uk-grid"> [...] <div class="uk-width-medium-3-4"> <?= editlink($post->id); ?> <h4><a href="<?= $post->url ?>"><?= $post->get('headline|title') ?></a></h4> [...] </div> </div> <hr> <?php endforeach; ?> the result is something like that: note that it needs only 2 lines of code! you can easily add this to any existing website in minutes... in FREDI you have to define your editable fields. that can be an advantage, but i prefer to only rely on the ID of the page (or the posting or the widget...) and have the user redirected to the right page in the backend. as you can see in the commented section of the function i also had this working with a colorbox and using modal=1, but it's more foolproof having it open in a new tab. using only the ID has the advantage, that if something changes with my field settings i don't have to change anything on frontend. how does it work? it injects some jquery javascript inline (it's only for logged in users so that won't affect your "public" markup of the page!) add HTML for the edit-button with edit-link add javascriptadd "editlinkparent" to parent DOM element this makes it possible to show the border around the affected content on mouse hover remove spacing so that the edit-button is on the very topright position of the highlighted div that's all again: i would love to pack that into a module so that it gets reuseable across other CSS frameworks with different markup and you don't have to care about adding the function and the css, but i don't know when i can find time for that. if anyone wants to try - all the info is above and i'm always willing to help1 point
-
Howdey! Over the last weeks, I had some critical thoughts about processwires ui/ux feeling (relative sizing, overflow-x, hover-states, word-wrap:break-word) but also its stability. Last night I had the time to setup some new things. Good point for me to fiddle a bit around, with issues I've seen over the last months... ...short break: A lot of bugs, I've noticed earlier, are gone... @allcontributors I ♥ you! However, someone left over some bugs, for me ;-) I just ended up with an ugly and unstructured markdown file. No issues or pull-requests via git. The biggest reason, most things are between "bug" and "enhancement" or are just too platform specific. I think, it's better to talk about those stumbling blocks first. Ok, enough for now. As I said, it's markdown, to see the compiled thing, take this: https://gist.github.com/yckart/62b7b2ed9d0e3845cc4b # Bugs - Mobile (iOS 8) ## Navigation closes immediately **Description** Menu opens (for less than ~100ms) and closes immediately again. **Reproduce** Click on the upper left menu icon, scroll a bit down (~10px), click menu icon again. Try to open the menu. ## "Add New"-menu unclosable **Description** Shortcut-menu to add new pages, can not closed again with "Add Menu"-button. **Reproduce** Click on "Add New" (is open), click again to close (is still open). **Solution** It's something about the hover-state in mobile safari. Adding `ontouchstart` to `<body>` could help. Better, listen for events and change states via javascript. ## ProcessLister not reachable **Description** Lister (filter/related) is not "reachable". **Reproduce** 1. Open backend on iOS. 2. Try to find/reach "lister" and "recent-pages" **Solution** Add a dropdown-menu with infinite levels of nesting. See also [#show-fullpage](#show-fullpage) ## <a name="input-auto-zoom-bug">#</a> Input auto zoom bug **Description** If an input gets the focus, the page will zoomed in a bit. Causes horizontal scrollbars. See also [#horizontal-overflow](#horizontal-overflow) **Reproduce** Focus a text input element in the backend. **Solution** `html { text-size-adjust: 100%; }` **References** - http://stevenosloan.com/articles/2013/prevent-zooming-on-forms/ - http://stackoverflow.com/questions/2989263/disable-auto-zoom-in-input-text-tag-safari-on-iphone ## <a name="horizontal-overflow">#</a> Horizontal overflow **Description** Causes horizontal overflow on some pages, mostly because of long words/text. See also [#input-auto-zoom-bug](#input-auto-zoom-bug) **Reproduce** View "ProcessPageEditImageSelect"-configuration page **Solution** `word-wrap: break-word` ## SystemNotifications ghost doesn't break words **Description** Ghosts do not break long text on iOS. **Solution 1** It's something with `position: fixed; width: 100%` and `position: fixed; left: 0; right: 0;`. **Solution 2** I've seen some problems with `word-wrap: break-word`, I think there are some bugs related to this topic. See also [#horizontal-overflow](#horizontal-overflow) ## ProcessPageSearchForm too small **Description** Input field is a bit too small, for my eyes. --- # UI/UX ## ProcessPageEditImageSelect image not scaled **Description** The currently edited image in modal is not scaled down. We are able to define dimensions (e.g. 800x600), it seems that the image will get exactly this pixel-values as dimension-properties, makes the thing feel not that responsive as it could/should. **Reproduce** 1. Open page with image field attached 2. Click an image (larger than the device viewport) to open modal. **Solution** Haven't looked deep in it, but something like this should help: `img { max-width: 100% ...` ## PageTable ### Drag breaks layout **Description** Dragged item is not longer in box-model (due `position:absolute`) and visually breaks the table. **Reproduce** Move cursor over table item > hold mousedown and drag ~1px. **Solution 1** Create clone and move this instead of original PageTableField. **Solution 2** Save offset, before the PageTableField gets `position: absolute`. ### PageTable optional sorting **Description** Sorting via drag-and-drop should be optional. Currently we can say that items added to PageTable are "pre-sorted" with `Inputfield_sortfields`, but they are furthermore sortable via drag-and-drop. **Solution** Add "Sortable via drag-and-drop"-option to PageTable ## NotificationBug alignment/position **Description** It's annoying to have the NotificationMenu-toggler move always up/down (and it looks a bit too "floaty" in my eyes). **Solution** Move the NotificationBug right to search form and "fix" (not `fixed`) it at the top. --- # Feature requests ## <a name="show-fullpage">#</a> Show fullpage **Description** It could be helpful to be able to switch (on mobiel devices) between mobile- and desktop version. **Solution** Add "Show fullpage"-link to footer ## Inline time picker on datetime field **Description** If the date picker is inlined (always visible) theres no time picker available. ## <a name="line-trough-draft-pages-asmselect">#</a> Line trough draft pages AsmSelect **Description** In PageLister a page with status "draft" is striked (~~line-through~~), should be the same in asmSelect (if "Allow unpublished pages" is enabled). See also [#asm-page-state](#asm-page-state) **Reproduce** 1. Enable draft pages on PageTable. 2. Change page status to draft. 3. Open the referenced page and view select-field item. ## <a name="asm-page-state">#</a> Indicate page-states in asmSelect **Description** Each state could visualized with different styles. See also [#line-trough-draft-pages-asmselect](#line-trough-draft-pages-asmselect) **Solution** - draft > ~~line-through~~ - hidden > opacity - locked > *italic* ## Image-reference selection **Description** Selecting already uploaded images, from any page, is a must have! **Solution** Indri is one great tool for this, https://github.com/ikayzo/indri ## Create page once **Description** It should be a possibility to create pages (one the same tree-level) just once, instead of renaming to "duplicate-page-name-1". **Reproduce** 1. Create new page with name "foo". 2. Create another page with name "foo". 3. Now you have "foo" and "foo-1". **Solution** Add "Singular"-option to templates to let us decide what we want. If this option-field is ticked later, on page edition show notification if page with name "foo" already exists and don't save, or ask what todo. ## Pre-select site-profile **Description** If there's just one site-profile to install, use it. ## Show full version number on installation **Description** During installation the version in footer-section is trimmed e.g. 2.5.29 => 2.5 ## Dynamically enable field deletion **Description** Ajax-check to enable "Delete field" after valid change on "Action"-tab.1 point
-
I've just checked, the module does work out of the box with FieldtypeOptions, so nothing to do for me Edit: At least for the "Interface". Seems like Ryan did not include an option for adding new options from the inputfield by now, like it's for FieldtypePage. The thing I don't like about including it myself is, that I can't really guess a value for the field, while this would give the ability to change the wording afterwards, even if it's only a typo. Maybe we should first ask Ryan if he could implement a standartised way for auto values, then it would be easy to include a "add option" field like for pages. I'll open a feature request over on github.1 point
-
Just had one more thought for you - how hard do you think it would be to also offer this as an inputfield for Ryan's new Options fieldtype, in addition to the Pages fieldtype that is currently uses. Thought it might be nice because with tags it is often unlikely that you actually need these to be accessible via a URL, hence no real need for having them as pages now that we have this new fieldtype. Just thinking out loud if you are looking for something to do1 point
-
I deliberately try not to use modules unless I need them. There really is a lot you can do with the core/API alone, so I tend to consider modules as convenient helpers, usually to cover for when my puny PHP skills don't suffice. That being said, I recommend: Markup Simple Navigation – to dynamically generate almost any navigation structure Map Marker (Google Maps) – if you ever need users to be able to generate Google Maps, this is a lifesaver XML Sitemap – it's one of the basic SEO things, and no one should have to generate an XML sitemap manually Language Field Tabs – as if multi-lingual sites weren't awesome enough in PW already, this makes it even better Forgot Password (Core) – never, ever forget to install this; if a project has more than one user, someone will forget their password at some point1 point
-
Greetings, What makes ProcessWire so excellent is the ability to do all kinds of work at the API level, so that you can essentially create a custom admin for your projects. Editing a page is of course a crucial part of any custom admin. NOTES: Of course, you must cutomize this to your project. Also, in my code I am editing the page directly inside the page itself. In other words, you display a page as usual, but inside it you have your edit code, as well as code to save the page after editing. The other option would be to link to another page just for editing. Editing does get rather involved. Below is a technique I've used. I'll break editing down to several steps, then later I'll put it all together as one. Here goes... Step 1: Isolate Who Has Editing Rights You don't want anyone who can view the page editing it! I use code like this to limit editing to people with either an "editor" or "superuser" role. We open it here, and close it later in Step 6: <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { Step 2: Set the $page Variables (Except Title) to Hold Edited Values Take inputs received from a submitted form and use those values to replace current $page values. For this example, I am only using two fields to keep it simple. And they are text fields. We hold off on setting the title, since that needs special handling: <?php if ($input->post->title) { $page->set("first_name", $sanitizer->text($input->post->first_name)); $page->set("last_name", $sanitizer->text($input->post->last_name)); } Step 3: Edit Title Field, but Only if the Title is Unique, Then Save the Page You need something like this so you don't get an error if the title you apply to the edited page collides with the title of an existing page. The code below confirms that the title is unique and allows you to set the title, and only then save the page: $thistitle = $page->title; $matchedtitle = $input->post->title; $checktitles = $pages->find("parent=/[path]/[to]/[parent]/, title=$matchedtitle|$thistitle"); $titlecount = count($checktitles); if($titlecount < 2) { $page->of(false); $page->set("title", $sanitizer->text($input->post->title)); $page->set("name", $sanitizer->text($input->post->title)); $page->save(); Step 4: Refresh URL Think about it... If while editing this page we changed the title, the URL you are on is no longer valid. Here's a simple bit of Javascript to handle this. The code below also closes out the conditional set in Step 3: $refresh=$page->url; ?> <script type="text/javascript"> window.location = '<?php echo $refresh ?>'; </script> <?php } Step 5: Handle the Scenario When the Page Title Collides In Step 3, we edited the page title because it passed the "unique" test. But what if it fails that test? We would move to this section of code, where a message lets the user know there is a problem. A bit of Javascript helps make the warning fade in so it is more noticeable: else { ?> <div class="admin_error_box"> <p>Sorry, there is already a page using this title: <?php echo $input->post->title?>!</p> <p>Please enter a different title in the form.</p> </div> <script> $(function() { $('.admin_error_box').hide().fadeIn(3000); }); </script> <?php } Step 6: The Edit Form We need a form to capture the submission of edits. It would look the same as your page-creation form, but would have to be pre-populated with the current values of the page, which will also change upon submission of the form. The last bit of code closes out the check on user roles set in Step 1: <div class="page_create_form_box"> <p class="form_heading">EDIT THIS PAGE USING THE FORM BELOW</p> <form action="<?php echo $page->url ?>" method="post"> <ul> <li><label class="label_class" for="title">Page Title:</label> <input type="text" class="input_class" name="title" value="<?php echo $page->title ?>"></li> <li><label class="label_class" for="first_name">First Name:</label> <input type="text" class="input_class" name="first_name" value="<?php echo $page->first_name ?>"></li> <li><label class="label_class" for="last_name">Last Name:</label> <input type="text" class="input_class" name="last_name" value="<?php echo $page->last_name ?>"></li> </ul> <button class="admin_submit" type="submit" name="submit">SAVE EDITED PAGE</button> </form> <?php } ?> Step 7: Putting it all Together Now let's put all of this code into one continuous routine. <?php if ($user->isSuperuser() OR $user->hasRole("editor")) { ?> <?php if ($input->post->title) { $page->set("first_name", $sanitizer->text($input->post->first_name)); $page->set("last_name", $sanitizer->text($input->post->last_name)); } $thistitle = $page->title; $matchedtitle = $input->post->title; $checktitles = $pages->find("parent=/[path]/[to]/[parent]/, title=$matchedtitle|$thistitle"); $titlecount = count($checktitles); if($titlecount < 2) { $page->of(false); $page->set("title", $sanitizer->text($input->post->title)); $page->set("name", $sanitizer->text($input->post->title)); $page->save(); $refresh=$page->url; ?> <script type="text/javascript"> window.location = '<?php echo $refresh ?>'; </script> <?php } else { ?> <div class="admin_error_box"> <p>Sorry, there is already a page using this title: <?php echo $input->post->title?>!</p> <p>Please enter a different title in the form.</p> </div> <script> $(function() { $('.admin_error_box').hide().fadeIn(3000); }); </script> <?php } ?> <div class="page_create_form_box"> <p class="form_heading">EDIT THIS PAGE USING THE FORM BELOW</p> <form action="<?php echo $page->url ?>" method="post"> <ul> <li><label class="label_class" for="title">Page Title:</label> <input type="text" class="input_class" name="title" value="<?php echo $page->title ?>"></li> <li><label class="label_class" for="first_name">First Name:</label> <input type="text" class="input_class" name="first_name" value="<?php echo $page->first_name ?>"></li> <li><label class="label_class" for="last_name">Last Name:</label> <input type="text" class="input_class" name="last_name" value="<?php echo $page->last_name ?>"></li> </ul> <button class="admin_submit" type="submit" name="submit">SAVE EDITED PAGE</button> </form> <?php } ?> My apologies for any problems with the formatting of the code above (please use your editor to assure proper tabs). Notes: - If you include checkboxes or other field types in your page, the editing is a bit more involved. - If you have image fields, you would have separate actions connected with those. For more information on handling image fields in custom forms, take a look at this: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ That should get you started! Follow up if you have more questions! Thanks, Matthew1 point
-
1 point