Leaderboard
Popular Content
Showing content with the highest reputation on 02/09/2017 in all areas
-
I agree with Adrian, there's no point on doing this with PHP when you can do it easily with CSS. Besides, if someone loads the site on a small window, and then resizes the window, you'll have less content on a larger screen. Is your reason purely layout related, or are you trying to spare mobile users from loading content? That can also be fixed with JS, and some browsers won't even load images that are not displayed. In your code you're trying to load a PHP file with javascript. for what I see, either you have those files on the root of the site without PW code, or it won't work at all. Anyway, I strongly discourage you to load content through AJAX if only for templating purposes. Here's how you can do it with CSS: @media only screen and (max-device-width: 720px) { .articles-parent article:nth-child(n+6) { display: none; } } This would hide the last 6 posts when the screen is narrower than 720px.4 points
-
Thanks all for the hints! Yup, it was just the wrong default value: Fixed now: https://github.com/blynx/TextformatterVideoEmbedOptions3 points
-
yep: /** * Installer: Database Configuration * */ $config->dbHost = 'localhost'; $config->dbName = 'pwtest'; $config->dbUser = 'root'; $config->dbPass = ''; $config->dbPort = '3306';3 points
-
Well given that PHP can't determine the screen width, you'd have to get it via JS and then do an AJAX call based on that width. Honestly I don't think there is much point to that. Just get as many posts as you need for the widest screens and then limit their display with css or js.3 points
-
Issue has been opened on GitHub: https://github.com/processwire/processwire-issues/issues/1833 points
-
I used a much simpler and faster method utilizing the pagefile class. My link looks like this: // Sorry for smarty language. but thats what I used {if $page->files|@count > 0} {foreach $page->files as $file} <p> {if $file->description} {$file->description} {else} {$file->name} {/if} <br> <a href="download/{$file->name}" class="link-icon">Download</a> | {$file->filesizeStr} </p> {*{/if}*} {/foreach} {/if} and then in my _init.php I used the following code if ($input->urlSegment1 == 'download') { $download_options = array( // boolean: halt program execution after file send 'exit' => true, // boolean|null: whether file should force download (null=let content-type header decide) 'forceDownload' => true, // string: filename you want the download to show on the user's computer, or blank to use existing. 'downloadFilename' => '', ); session_write_close(); if ($input->urlSegment2) { $pagefile = $page->files[$input->urlSegment2]; if($pagefile){ wireSendFile($pagefile->filename, $download_options); } } } EDIT: The downside when implementing this in the _init.php is, that you can´t send a Wire404Exception, because this file gets included (prepended) and PHP doesn´t like exeptions in included files. If you paste this code into one of your templates you could add trowing a Wire404Exception.3 points
-
Looks like internally $sanitizer->date() is relying on strtotime() to check that the date is valid, and this function for some reason returns a timestamp for '2017/02/31' rather than 'false'. It should perhaps be changed to checkdate() which correctly identifies that date as invalid. In the meantime you could add an extra validation: function validate_date($value) { $parsed = date_parse($value); return checkdate($parsed['month'], $parsed['day'], $parsed['year']); }2 points
-
Good day! I do not know what exactly is happening, just trying to move the topic forward. Please provide more details. I understood that you got a ckeditor.js failed to load message in your browser console on some non-admin url of your site when trying to open a front-end editing popup. Is that right? Please provide more details/context/screenshots to make it easier to answer. Seems to be PW unrelated problem. Did you check some ckeditor related answers? I know, it's close to "go google it", but that is how I would start.2 points
-
Hi everyone! Introducing the new Style Admin by Server Type feature. Hopefully this will reduce the chance of accidentally editing the wrong version of a site when you have more than one open in different tabs. Firstly, a huge shoutout to @szabesz for the idea for this new feature and for lots of testing and suggestions to improve it. Also @tpr chipped in with some CSS help yet again! This feature adds a ribbon down the side of the admin to let you know what version of the site you are on, eg. local, dev, staging, etc. Firstly you will need to enable it in the config settings. Then you'll want to set up your various server types and colors. It comes with the following defaults. If you don't like the side ribbon, you can actually style the output exactly how you want.2 points
-
@microcipcip WireHttp is meant as a replacement for external PHP http client libraries like guzzle etc. You would want to use these when you 'talk' to the REST API that you set up with PW. Don't confuse this with clsource's Rest Helper class that I am using in my tutorial. You would still use that to build your REST API on the PW side. Today, If I wanted to develop a PW application that exposes JSON data through an API I would go with the brandnew GraphQL module by Nurguly. Seems like a much cleaner approach compared to REST.2 points
-
This module allows you and your site editors to protect a page (and optionally its children, grandchildren etc) from guest access directly from the page's Settings tab. You can also limit access to certain roles. http://modules.processwire.com/modules/page-protector/ https://github.com/adrianbj/PageProtector It makes it very easy for editors to set up various password protected areas on their site, or to simply protect a new page or section while they are still working on it. Ability for your site editors to control the user access to pages directly from Settings tab of each page Include whether to protect all children of this page or not Optionally allow access to only specified roles Option to protect all hidden pages (and optionally their children) Ability to change the message on the login page to make it specific to this page Option to have login form and prohibited message injected into a custom template Access to the "Protect this Page" settings panel is controlled by the "page-edit-protected" permission Table in the module config settings that lists the details all of the protected pages Shortcut to protect entire site with one click In addition to the admin interface, you can also set protection settings via the API: // all optional, except "page_protected", which must be set to true/false // if setting it to false, the other options are not relevant $options = array( "page_protected" => true, "children_protected" => true, "allowed_roles" => array("role1", "role2"), "message_override" => "My custom login message", "prohibited_message" => "My custom prohibited access message" ); $page->protect($options); As alway, I would love any feedback / suggestions for improvements. Hope you find it useful! Page Protection Settings (settings tab for each page) Module Config Settings1 point
-
PageTableExtraActions A module for ProcessWire CMS/CMF. Allows PageTable items to be published/unpublished and hidden/unhidden directly from the inputfield. Usage Install the PageTableExtraActions module. Use the icons in the "Actions" column of a PageTable field to publish/unpublish or hide/unhide an item. https://modules.processwire.com/modules/page-table-extra-actions/ https://github.com/Toutouwai/PageTableExtraActions/1 point
-
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
-
This is a very simple module that I put together for @Zahari Majini from a PM request. It allows you to enter a URL to a YouTube or Vimeo video in a specified field and when you save the page, it will grab thumbnails for the video and add them to a specified images field. Check the module configuration options for: the field(s) to search for videos name of the video images field which thumbnail(s) you want grabbed whether to grab the first available or all available thumbnails based on those that you list As always, an feedback for improvements is very welcome! Modules Directory: http://modules.processwire.com/modules/process-get-video-thumbs/ Github: https://github.com/adrianbj/GetVideoThumbs1 point
-
Soundmanager2 Audio for Processwire Github: https://github.com/outflux3/TextformatterSoundmanager Modules Directory: http://modules.processwire.com/modules/textformatter-soundmanager/ This module provides most of the free audio player interfaces for Soundmanager2 by Scott Schiller: Bar UI 360 UI 360+ spectrum UI mp3 buttons mp3 links Page Player, muxtape-style UI Cassette Player The module is a Textformatter that works by allowing you to insert shortcodes which are parsed into audio players. The players may be placed anywhere in the content (ck editor or other text field) using the shortcode, for example: [smplayer tag=audio1] The output will be a default single player (as specificed in the module settings), or if multiple audio files have the same tag, and you don't specify a type (UI), it will default to the Bar UI for the playlist. You may also specify page-player for the type as it also supports playlists. Here is a more complex tag: [smplayer tag=audio1 type=bar-ui color=2288CC] the tags available on shortcodes are: tag - *required to find the audio file on the page type (the type of player) limit (limit the number of files to load when using a playlist) Player specific tags for Bar UI: bar-ui (options for the bar-ui player) skin (applies to a bar-ui skin to load) extra (when set to true, it will display the extra controls) color (hex value for color - applies to bar-ui and mp3 buttons) compact (makes the player very narrow) playlist-open (make the playlist drawer open instead of needing to click the playlist button to open it.) dark-text (instead of white) flat (remove the faux 3d effect) When using the shortcode, you can chain the tags using underscore, for exmaple: [smplayer type=bar-ui bar-ui=flat_playlist-open_dark_text] Player specific tags for Cassette: cassette (options for the cassette player) In case you are not familiar with SM2, it powers a lot of major audio on the web, like Soundcloud, LastFM, AllMusic etc). The players are all rock solid and work on a wide range of browsers and devices. Features Multiple Audio Formats SM2 supports many formats, and those can be enabled/disabled in the module config if you want to prevent any from being loaded. So far this module was tested with MP3 and AAC (.m4a). GetID3 Support When enabled, ID3 tags from every audio file that pass through the Textformatter are read and cached as arrays using WireCache. Therefore the first load of a page with new audio files may be slow while the tags are read and stored. The tags are indexed by the filename of the audio, so as long as you don't upload multiple files with the same filename, or change the tags, the system will store the metadata permanently. To remove any metadata, you would need to use Soma's Cache Admin module, or clear it from the database. Schema Support When enabled, some schema tags relating to audio files will be added to the markup. CK editor Plugin Very basic dropdown that inserts some pre-configured player codes into the editor. Copy the plugin into your CK editor plugins folder, enable and add a button for 'soundmanager'. Instructions Before you install: 1) You will need a files field that accepts audio files, so set the extensions you want to use, such as mp3, m4a, mp4, wav etc. 2) Also make sure that you enable tags on the files field because the module references the tags for any audio file in the shortcode. 3) Add the files field to your template. Installation and Setup 1) Install the module and adjust your settings from the module configuration screen. 2) Add the TextformatterSoundmanager textformatter to the field where you want to insert audio (e.g. 'body'). 3) Optionally install the CK editor plugin to enable quick access to preconfigured shortcodes. 4) Add a shortcode into the textarea field that has the textformatter applied to. 5) You must reference the tag you entered in the audio file's tag field in the shortcode, and that will create a player for that audio file. 5a) To create a playlist, put the same tag in multiple audio files. Output 1) In order for the module to output the necessary styles and scripts, you need to echo the $config->styles and $config->scripts arrays into your site's header/footer. Here is an example: // In Header foreach($config->styles as $style) echo "<link rel='stylesheet' type='text/css' href='{$style}' />\n"; // In Footer foreach($config->scripts as $script) echo "<script type='text/javascript' src='{$script}'></script>\n"; API Usage To access the module's player method directly, you would first init the module in your _init.php file: $sm2 = $modules->get('TextformatterSoundmanager'); then anywhere in your templates, you can output any audio file with any player, in an configuration like this: $options = [ 'type' => 'bar-ui', 'skin' => 'gradient-fat', //'tag' => 'audio1', // tag is not needed when using the API //'bar-ui' => 'playlist-open' //all of the classes to apply to the bar ui. ]; foreach($page->audio as $track) { $content .= $sm2->player($track, $options); } Advanced Features Using other pages for storing music as playlists. You can create a field to hold a tag for a **page* and then refer to that tag in your shortcode. The shortcode word would be smplaylist instead of smplayer. The module will search the site for pages with that tag in that field. Then it will output all of the audio files in that page's audio field using the player and settings you specify. See the module configuration to select the tag field and adjust your shortcode words. Caveats Some player will not work well on the same page as other players. Bar UI and Page Player 360 Player and 360 Visual (large) players Also note that the cassette player can only occur once on a page. You can have multiple cassettes output, but they will all play the same audio file. The file that the cassette player uses is set in the script tag. In the future the setup may be modified to allow for cassette players to have their own audio files. About Soundmanager2 http://www.schillmania.com/projects/soundmanager2/ Speak and be heard More sound, in more places Despite being one of the senses, sound has largely been missing from the web due to inconsistent technology support. SoundManager 2 bridges this gap, making it easier to use audio across a growing variety of devices and platforms, both desktop and mobile. HTML5 + flash hybrid Complexity, reduced Supporting HTML5 audio can be tedious in modern browsers, let alone legacy ones. With real-world visitors using browsers ranging from mobile Safari to IE 6 across a wide range of devices, there can be many support cases to consider. SoundManager 2 gives you a single, powerful API that supports both new and old, using HTML5 audio where supported and optional Flash-based fallback where needed. Ideally when using SoundManager 2, audio "just works." The ginsu knife: 12 KB Big features, small footprint Performance is an important metric, too. SoundManager 2 packs a comprehensive, feature-rich API into as little as 12 KB over the wire when optimized; that's less than 8% of the original, uncompressed file size. SM2 is self-contained, having no external dependencies, and is compatible with popular JavaScript frameworks. The source code is BSD-licensed and is provided in fully-commented, non-debug and compiler-optimized "minified" versions appropriate for development and production use.1 point
-
If you want your hook to fire on the saving of all pages but the one you are updating in your hook you would do: public function UpdateAnotherPage($event) { $page = $event->arguments('page'); if($page->id !== 1240) { // update page 1240 } }1 point
-
This jQuery plugin seems to do the job without any obvious performance issues: http://laertejjunior.github.io/freezeheader/1 point
-
Maybe you can try https://forge.laravel.com/, from the author of the Laravel framework. I use it for my DigitalOcean droplets and it's great! You can use it to setup a server on Amazon, Linode or with a custom VPS too.1 point
-
Welcome @VirtuallyCreative! substr() is the function that is usually used to get a portion of a string in PHP. substr($page->title, 0, 2)1 point
-
Check document.getElementFromPoint(point close to top) if it's in one of your tables and either check only that one's scrollTop or see if it is not inside the thead?1 point
-
1 point
-
Hi @Alfonso Rodriguez. Welcome to the forums and ProcessWire. Is this a remote site or on a local install? In your /site/config.php, set the following: $config->debug = true; That will show if there are any errors. Please note that the directive may show some information that is only intended for superusers. So, if you are on a remote/live site, I'd only show that to superusers. If that is your case, let us know so we can show you how to go about it. If you have debug on, do you see any errors? What do they say? Did you see any warnings (red) during the install Process? E.g. ProcessWire complaining about a requirement not being met Is the frontend working? What is your server environment like? PHP and Apache version? or a Windows environment? There's a couple of topics around 'blank' screens but not sure which one applies in your case. Here's a couple: https://processwire.com/docs/install/troubleshooting/1 point
-
@Martin Muzatko. This might be of interest?1 point
-
@dab Could you please pull the latest version from branch develop? I fixed this already some time ago but haven't released it yet.1 point
-
justb3a, thanks for such a lovely script! This works perfectly with SimpleContactForm 1.0.0 on Processwire 3.0.42 <?php $scf = $modules->get('SimpleContactForm'); $options = array( 'btnClass' => 'button fit big', 'btnText' => 'SEND MESSAGE!', 'successMessage' => 'Message Sent!', 'errorMessage' => 'Sorry - message send error!' ); echo $scf->render($options); ?> But if you just use this (without specifiying the successmessage) e.g. <?php $scf = $modules->get('SimpleContactForm'); $options = array( 'btnClass' => 'button fit big', 'btnText' => 'SEND MESSAGE!' ); echo $scf->render($options); ?> The form processes (send) correctly, but the form output on the web page after sending is shown as: <p class='form--success--message'>SEND MESSAGE!</p> Showing the 'btnText', rather than the correct 'default success message'. Have I missed someting obvious? I've posted just incase anyone else is having the same issues.1 point
-
It would be great if inputfield dependencies would support multiple conditions with OR (see: https://processwire.com/talk/topic/15495-inputfield-dependencies-possible-to-add-multiple-conditions-with-or/) For example: condition1=1||condition2=1 The OR operator could be for example "||" and the AND operator is ",". Best regards1 point
-
Can't found the answer on the IPB doc. Is there a limit to the number of participants in a private conversation ? Look like 5 is the max. Another little thing about the "module tag" in modules forum, its width is huge : Nothing really annoying but every day I wonder if this is normal, as every module does not contains the tag, and if it was the case, this will be 'huge' imo.1 point
-
Need calendar functionality for a few of my sites and it was doing my head in. After much research, trial and error, decided to go back to the KISS principle (Keep It Simple Sweetie). PW handles dates well so can just be fields in templates Selectors allow you to define start and end end dates easily Want each event page to be a child page of the Calendar page and editable in its own right Only issue was recurring events and this post has given me ideas Am going to adapt Mr NiceGuys code to suit. Happy camper!1 point
-
I think you can do this with core PW fields, and enhance it with some custom JS if you want. Here's what I'm thinking... You have your Place pages in their own branch of the tree. The Place template has a repeater field "Offers" where all the possible offers for that Place are defined. Then you have a repeater field "Places" on your Partner template. You add two Page Reference fields to the repeater: 1. "Place", which is a single select field limited to the Place template. 2. "Choose offers" which is a multiple AsmSelect field using a "Custom PHP code" hook. The hook will return the value of the "Offers" repeater field (which will be a PageArray) for the place that is selected in the "Place" field. Now this hook is a bit trickier than normal because your Page Reference fields are inside a repeater and so you don't want $page to be the page being edited, but rather the repeater page that contains your fields. So in the hook you need to get the inputfield name and extract the ID integer portion of it and use that to get the $page object. I can explain more about this if you decide to go down this road. So this approach should work but it will require editors to save the page after choosing a place in the "Place" select, before they can choose offers for that place. If you wanted to enhance it a bit more you could have the "Choose offers" field allow all offers pages (limit using the Offers repeater template rather than a custom PHP hook) and then use some custom JS in admin to empty the inputfield options on load and on change of the "Place" select it gets the offers for that place via AJAX and populates the "Choose offers" options.1 point
-
You would need a NAS that can run a webserver with PHP and MySQL. Or a Raspberry PI 3B.1 point
-
THis is awesome, thanks so much for sharing. I'm just getting into docker for my local pw development (on windows) and this will be fantastic. Not knowing too much about docker, is there a way to use docker compose to simplify the commands that are needed to get this running? From what I understand, compose allows you to put all those setup commands for all 3 containers into a config file that can be run with one simple command. Could this be used as a launching board to make something like wocker but for processwire?1 point
-
What @LostKobrakai said. Here's an example: https://processwire.com/talk/topic/9730-get-pages-used-by-a-pagefield/?do=findComment&comment=97464 Use that in your 'custom PHP' for returning pages for that page field.1 point
-
Oh, only the files are on the NAS. Then I'd imagine this slow-down is to be expected. Network drives are slow (and XAMPP not the fastest to begin with). Network drives can be quite fast transfering single bigger files, but for lots of small files like a php project it's bad.1 point
-
Hey @Christoph. There was no inconvenience and no need to apologise . It's just that a properly formulated question not only helps those who can potentially come up with a solution, but also those who might have a similar problem in the future will be able to easily relate. Glad you got it working and thanks for sharing your solution!1 point
-
It is only option D that forces the modal dialog editor. Option C allows inline editing - you just have to place edit tags around the individual fields in your repeater rather than around the whole repeater foreach(). For example: <?php foreach($page->my_repeater as $item): ?> <h3><edit <?= $item->id ?>.title><?= $item->title ?></edit></h3> <?php endforeach; ?> You're right that there does seem to be some sort of permissions issue for non-superusers, but rather than change access for the admin template (which non-superusers shouldn't have access to) I suggest you give edit access to your repeater template (select the "Show system templates" option to see repeater templates).1 point
-
Did you check the front-end editing documentation when investigating your problem? It specifically advises against using option B for Repeaters:1 point
-
Ok, sorry for any inconvenience! While trying to better explain my problem I came up with a solution. Because the issues described in the post mentioned above are related, as I discovered, I wrote my solution over there: So, this thread is obsolete.1 point
-
This module is now available on GitHub. Still beta, but working well on all sites tested on. More documentation coming soon. If anyone out there needs inline audio on your site, check this out. ** make sure to read the instructions on Github, as those will always be updated to the latest (hard to keep the instructions here sync'd with the module instructions)...1 point
-
Thank you @Werner Pilnei. I am excited because I like using ProcessWire . I try to do my best in introducing this module to the community. GraphQL is very young standard and is not mainstream yet. I intentionally started this thread in the Pub section, to make sure this is not a module support page but more a discussion on GraphQL (as this new api standard by facebook) and ProcessWire. To talk about how they could fit with each other, what ways we could use it, the new ways to use ProcessWire and so on. I personally never think about ProcessWire as a CMS. Though it is in fact a true CMS in its literal meaning, it is best at managing your content. But when people are introduced to ProcessWire it is presented as CMS and since the web is cursed by WordPress, people start using ProcessWire with wrong assumptions in their minds which result in negative impressions. I am generalizing here but when an average web developer hears CMS, she thinks it is a ready website with bunch of functionality baked in like tags, searching, blogging, commenting and so on. Those functionalities become the evaluation criteria and when they see that there is no tags in ProcessWire they count that as one of the things ProcessWire is missing. They don't understand that tags are something ProcessWire shouldn't have, because they are used to see tags in a CMS. I don't think that I am telling something new here. The community is well aware of this problem and the release of new site profile states that these problems are being addressed. But it doesn't have to be the only way. The modular architecture of ProcessWire allows us to extend it anyway we want, and this module is one of those attempts in presenting ProcessWire in different perspective. Even if it won't make much difference, I think we should keep trying and experimenting. Who knows what could come up along the way. I was only thinking about SPAs when creating this module. Never thought of PWA and usage with service workers like you approached it. Which is, by the way is great to hear. I hope there will be bunch of other ways people use it.1 point
-
As for organising your forms in the page tree, you could also save all form pages under one parent. When you save a form page via API, you can set the user who has created the form (which is the logged in $user). Some dummy code to achieve this $form = new Page; $form->template = 'form'; $form->parent = $pages->get('template=formparent'); /* set user who created this form */ $form->set("createdUser", $user); Then in the user's dashboard you get all the forms for that user with something like $forms = $pages->find("template=form, created_users_id={$user->id}"); I'm using this approach in some projects with frontend user dashboards and it works really well. Users can only see the content they created. All user content (here forms) lives under one parent page which makes it easy to create and query. Important note: in the backend you need to edit the form template and enable "Allow the 'created user' to be changed on pages?" under the "Advanced" tab. For the admin dashboard where forms for all users should be listed, you might want to spend a few bucks on Lister Pro. This saves you from developing a custom admin page. Lister Pro is very powerful and you can create a Lister that shows all pages with template form. You can list all forms sorted by created date, filter for forms of specific users etc. Also inline editing for the status field is possible. So admins can change the status very quickly. For the multi-step form: I also think that using Angular here would be overkill. I have a multi-step form that I render with PHP and use some very simple JS to step through the form. The form is divided into fieldgroups that reflect the steps. In the JS you can use AJAX to save the steps of the form that have been completed. Since you want to store the form data as JSON, you might want to look into a JS form framework that renders forms from JSON, something like Alpaca Forms. This would save you from creating the form rendering logic on the PHP side. They also support multi step form wizards. And, finally, what @adrian suggested above for creating users under different parents makes a lot of sense. I use this approach quite often.1 point
-
I have already started to build upon the new site profile: http://szabesz.hu/ I replaced uikit.min.css and uikit.min.js with their currently up-to-date counterparts (3.0.0 beta 9, February 3, 2017) so it looks OK in IE and Edge too.1 point
-
To quickly fix the issue just replace the below code from TextformatterVideoEmbedOptions.config.json "yt_showinfo": { "type": null, "value": 0, "label":"YouTube: Show Info", "description":"Supported values are 0 and 1.", "notes": "Default: 0" } to this: "yt_showinfo": { "type": null, "value": 1, "label":"YouTube: Show Info", "description":"Supported values are 0 and 1.", "notes": "Default: 1" }1 point
-
@blynx - FYI that is because of the way you have declared the version number: 033 Either use: 33 or '0.3.3'1 point
-
Remove the line where you call $prm->repeater_videos->add. getNew() already adds the item, you just need to fill and save it. Edit: the same should be true for $page->repeater_matrix_content->add1 point
-
After a quick research... Found this migration guide (PHP 7.0.x to PHP 7.1.x): http://php.net/manual/migration71.php Maybe this is somehow related to your issue: Implemented safe execution timeout handling, that prevents random crashes after "Maximum execution time exceeded" error. http://php.net/ChangeLog-7.php#7.1.0 Dumb question: Have you tried to restart nginx and double checked that it runs with the correct php-cgi/php-fpm and latest mariadb/mysql?1 point
-
Thanks bitpoet. Must have overlooked the clone function. And yes you understood it correctly that I wanted to create those virtual instance only on rendering. In the end I however decided to create real pages kind of like MuchDev suggested via module by hooking into the save function of the single-event pages. The admin for the single-event template now looks like this: https://monosnap.com/file/t187kaF2xI7WxF79blA3D982uMT1ko The code for the module is as follows. Adapt it for your needs <?php class recurringEvents extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Recurring Events', 'summary' => 'Adds a function to create recurring events and add pages to Processwire when a checkbox is checked on page save', 'version' => 1, 'autoload' => true, ); } public function init() { $this->pages->addHookBefore('save', $this, 'hookSave'); } public function hookSave($event) { $page = $event->arguments[0]; # check if recurring is checked on the page beeing saved. if ($page->recurring==1) { $intervallString=$page->intervall->title; for ($i=1; $i <= $page->n_repeats; $i++) { // create new page $k= new Page(); $k->template = 'single-event'; // set template $k->parent = wire('pages')->get('/events/'); // set the parent $intervall='+'.$i.' '.$intervallString; // construct the $intervall selector for strtotimestamp +1 week or +1day, increase with iteration by 1 $k->setOutputFormatting(false); // Copy page fields from current page to newly created one $k->title=$page->title; $k->organisation=$page->organisation; $k->type=$page->type; $k->location->address=$page->location->address; $k->body=$page->body; $k->recurring=0; $k->dateStart= strtotime($intervall, $page->dateStart); $k->dateEnd = strtotime($intervall, $page->dateEnd); $k->save(); } $this->message("Sucessfully created ".($i-1)." copies of recurring event {$k->title}"); // on the current page set recurring to 0 again, no page->save() needed because the page will be saved after the hook automatically $page->recurring=0; } } }?>1 point
-
Or use new $sanitizer->pageNameTranslate(str)1 point
-
Piwik also protects your visitor privacy with advanced privacy features When using Piwik for Web Analytics, you ensure that your visitors behavior on your website(s) is not shared with advertising companies1 point
-
This turns out more complex than it seems, but it is usually something not used that often or ever at all. Even with my experience took some time to get all pages, unpublished , published, hidden, not in trash and not under admin. This is with superuser logged in as I think as editor or guest user you won't get pages from trash anyway. But something like this is needed currently Unless I'm missing something. $pa = $pages->find("has_parent!=2,id!=2|7,status<".Page::statusTrash.",include=all"); foreach ($pa as $p) { echo "<li>$p->path</li>"; } Note that as soon as you got a few hundred or thousand pages you will get a problem Edit: id = 2 // is the /processwire/ admin parent id = 7 // is the trash include=all // to get all pages unpublished and hidden1 point