Leaderboard
Popular Content
Showing content with the highest reputation on 06/29/2018 in all areas
-
Hi all, Introducing a new GDPR Cookie Management Banner module. https://github.com/adrianbj/CookieManagementBanner https://modules.processwire.com/modules/cookie-management-banner/ This module was sponsored by VentureWeb in Squamish, BC, Canada. I converted a Drupal module written by Oliver Walker from VentureWeb into what you see here. The Drupal module requires jQuery so at the moment, this module also requires jQuery. I will probably remove this sometime soon. This module certainly has similarities to MarkupCookieConsent but provides the user with the following features: The user can accept all cookies or they can choose to not accept tracking/marketing cookies. Module config options allow you to: define all text and button labels (multi-language support) manually increment the cookie policy version which forces the user to review their consent again select whether users can manage their cookies, or just accept all option to limit display of banner to users only in European Union (by IP address) position selection (top or bottom overlay, or content pushed down from the top) It comes with basic default styling which is easily overwritten by site CSS The module sets various values to the dataLayer array which works together with Google Tag Manager - please read through the code in /assets/js/CookieManagementBanner.js to get a better idea of how this works and what is made available for GTM. You can wrap your tracking/marketing cookie code in a check for the localstorage key of: pwcmbAllowCookies if(localStorage.getItem('pwcmbAllowCookies') == 'y') You can also provide a link on your site (probably in the footer) like this that will allow the user to show the banner even after they have saved their preferences / accepted. <a href="#cookies" class="js-pwcmb-notice-toggle">Manage Your Cookies</a> Would love to hear feedback from anyone who gives this a go.16 points
-
This week we've got a lot of updates on our core dev branch, including new features, issue resolutions and more. For starters, we've added support for making the Trash and Restore features available to non-superusers, along with related improvements. Plus we've got several new useful and interesting page traversal methods and properties added to our $page API. https://processwire.com/blog/posts/processwire-3.0.107-core-updates/8 points
-
ProcessWire & Vue.js — a Lovestory Introducing the all new ICF Conference Website The new ICF Conference Page — Fearless » What would happen if we were equipped to fearlessly face the daily challenges and live a life without fear? « This question is at the core of our next ICF Conference in 2019 in Zurich. Its also the question we set out to answer in terms of developing the new website; the all new ICF Conference website is our most advanced website in terms of technology, designed to take advantage of the latest web-technologies. Its a brand new design powered by a lean setup, using ProcessWire for easy content management and a slick frontend based on Vue.js, Quasar and a heavily customized Uikit theme. Technology-stack — From backend to frontend, technologies that are fun, easy and fast to develop with We built on the ICF Ladieslounge website as a solid foundation and took our learnings from building our last Conference Booklet PWA (Progressive Web App) and applied it to the new website. Some highlights of the new ICF Conference website: Completely decoupled backend and frontend Custom design based on Uikit frontend framework Changing of languages happens instantly, no page-reload required Easy content updates thanks to ProcessWire All data is transferred using a single request returning custom JSON » Continue reading on Medium And please don't forget to clap and share:7 points
-
Hi there I'm in the UK but can help with this definitely - I've integrated the forum software we use here into ProcessWire (user logins, topic creation etc) and the rest sounds similar to a project I completed a couple of months ago actually ?3 points
-
Page Query Boss Build complex nested queries containing multiple fields and pages and return an array or JSON. This is useful to fetch data for SPA and PWA. You can use the Module to transform a ProcessWire Page or PageArray – even RepeaterMatrixPageArrays – into an array or JSON. Queries can be nested and contain closures as callback functions. Some field-types are transformed automatically, like Pageimages or MapMarker. Installation Via ProcessWire Backend It is recommended to install the Module via the ProcessWire admin "Modules" > "Site" > "Add New" > "Add Module from Directory" using the PageQueryBoss class name. Manually Download the files from Github or the ProcessWire repository: https://modules.processwire.com/modules/page-query-builder/ Copy all of the files for this module into /site/modules/PageQueryBoss/ Go to “Modules > Refresh” in your admin, and then click “install” for the this module. Module Methods There are two main methods: Return query as JSON $page->pageQueryJson($query); Return query as Array $page->pageQueryArray($query); Building the query The query can contain key and value pairs, or only keys. It can be nested and contain closures for dynamic values. To illustrate a short example: // simple query: $query = [ 'height', 'floors', ]; $pages->find('template=skyscraper')->pageQueryJson($query); Queries can be nested, contain page names, template names or contain functions and ProcessWire selectors: // simple query: $query = [ 'height', 'floors', 'images', // < some fileds contain default sub-queries to return data 'files' => [ // but you can also overrdide these defaults: 'filename' 'ext', 'url', ], // Assuming there are child pages with the architec template, or a // field name with a page relation to architects 'architect' => [ // sub-query 'name', 'email' ], // queries can contain closure functions that return dynamic content 'querytime' => function($parent){ return "Query for $parent->title was built ".time(); } ]; $pages->find('template=skyscraper')->pageQueryJson($query); Keys: A single fieldname; height or floors or architects The Module can handle the following fields: Strings, Dates, Integer… any default one-dimensional value Page references Pageimages Pagefiles PageArray MapMarker FieldtypeFunctional A template name; skyscraper or city Name of a child page (page.child.name=pagename); my-page-name A ProcessWire selector; template=building, floors>=25 A new name for the returned index passed by a # delimiter: // the field skyscraper will be renamed to "building": $query = ["skyscraper`#building`"] Key value pars: Any of the keys above (1-5) with an new nested sub-query array: $query = [ 'skyscraper' => [ 'height', 'floors' ], 'architect' => [ 'title', 'email' ], ] A named key and a closure function to process and return a query. The closure gets the parent object as argument: $query = [ 'architecs' => function($parent) { $architects = $parent->find('template=architect'); return $architects->arrayQuery(['name', 'email']); // or return $architects->explode('name, email'); } ] Real life example: $query = [ 'title', 'subtitle', // naming the key invitation 'template=Invitation, limit=1#invitation' => [ 'title', 'subtitle', 'body', ], // returns global speakers and local ones... 'speakers' => function($page){ $speakers = $page->speaker_relation; $speakers = $speakers->prepend(wire('pages')->find('template=Speaker, global=1, sort=-id')); // build a query of the speakers with return $speakers->arrayQuery([ 'title#name', // rename title field to name 'subtitle#ministry', // rename subtitle field to ministry 'links' => [ 'linklabel#label', // rename linklabel field to minlabelistry 'link' ], ]); }, 'Program' => [ // Child Pages with template=Program 'title', 'summary', 'start' => function($parent){ // calculate the startdate from timetables return $parent->children->first->date; }, 'end' => function($parent){ // calculate the endate from timetables return $parent->children->last->date; }, 'Timetable' => [ 'date', // date 'timetable#entry'=> [ 'time#start', // time 'time_until#end', // time 'subtitle#description', // entry title ], ], ], // ProcessWire selector, selecting children > name result "location" 'template=Location, limit=1#location' => [ 'title#city', // summary title field to city 'body', 'country', 'venue', 'summary#address', // rename summary field to address 'link#tickets', // rename ticket link 'map', // Mapmarker field, automatically transformed 'images', 'infos#categories' => [ // repeater matrix! > rename to categories 'title#name', // rename title field to name 'entries' => [ // nested repeater matrix! 'title', 'body' ] ], ], ]; if ($input->urlSegment1 === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Module default settings The modules settings are public. They can be directly modified, for example: $modules->get('PageQueryBoss')->debug = true; $modules->get('PageQueryBoss')->defaults = []; // reset all defaults Default queries for fields: Some field-types or templates come with default selectors, like Pageimages etc. These are the default queries: // Access and modify default queries: $modules->get('PageQueryBoss')->defaults['queries'] … public $defaults = [ 'queries' => [ 'Pageimages' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus', ], 'Pagefiles' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'filesize', 'filesizeStr', 'hash', ], 'MapMarker' => [ 'lat', 'lng', 'zoom', 'address', ], 'User' => [ 'name', 'email', ], ], ]; These defaults will only be used if there is no nested sub-query for the respective type. If you query a field with complex data and do not provide a sub-query, it will be transformed accordingly: $page->pageQueryArry(['images']); // returns something like this 'images' => [ 'basename', 'url', 'httpUrl', 'description', 'ext', 'focus'=> [ 'top', 'left', 'zoom', 'default', 'str', ] ]; You can always provide your own sub-query, so the defaults will not be used: $page->pageQueryArry([ 'images' => [ 'filename', 'description' ], ]); Overriding default queries: You can also override the defaults, for example $modules->get('PageQueryBoss')->defaults['queries']['Pageimages'] = [ 'basename', 'url', 'description', ]; Index of nested elements The index for nested elements can be adjusted. This is also done with defaults. There are 3 possibilities: Nested by name (default) Nested by ID Nested by numerical index Named index (default): This is the default setting. If you have a field that contains sub-items, the name will be the key in the results: // example $pagesByName = [ 'page-1-name' => [ 'title' => "Page one title", 'name' => 'page-1-name', ], 'page-2-name' => [ 'title' => "Page two title", 'name' => 'page-2-name', ] ] ID based index: If an object is listed in $defaults['index-id'] the id will be the key in the results. Currently, no items are listed as defaults for id-based index: // Set pages to get ID based index: $modules->get('PageQueryBoss')->defaults['index-id']['Page']; // Example return array: $pagesById = [ 123 => [ 'title' => "Page one title", 'name' => 123, ], 124 => [ 'title' => "Page two title", 'name' => 124, ] ] Number based index By default, a couple of fields are transformed automatically to contain numbered indexes: // objects or template names that should use numerical indexes for children instead of names $defaults['index-n'] => [ 'Pageimage', 'Pagefile', 'RepeaterMatrixPage', ]; // example $images = [ 0 => [ 'filename' => "image1.jpg", ], 1 => [ 'filename' => "image2.jpg", ] ] Tipp: When you remove the key 'Pageimage' from $defaults['index-n'], the index will again be name-based. Help-fill closures & tipps: These are few helpfill closure functions you might want to use or could help as a starting point for your own (let me know if you have your own): Get an overview of languages: $query = ['languages' => function($page){ $ar = []; $l=0; foreach (wire('languages') as $language) { // build the json url with segment 1 $ar[$l]['url']= $page->localHttpUrl($language).wire('input')->urlSegment1; $ar[$l]['name'] = $language->name == 'default' ? 'en' : $language->name; $ar[$l]['title'] = $language->getLanguageValue($language, 'title'); $ar[$l]['active'] = $language->id == wire('user')->language->id; $l++; } return $ar; }]; Get county info from ContinentsAndCountries Module Using the [ContinentsAndCountries Module](https://modules.processwire.com/modules/continents-and-countries/) you can extract iso code and names for countries: $query = ['country' => function($page){ $c = wire('modules')->get('ContinentsAndCountries')->findBy('countries', array('name', 'iso', 'code'),['code' =>$page->country]); return count($c) ? (array) $c[count($c)-1] : null; }]; Custom strings from a RepeaterTable for interface Using a RepeaterMatrix you can create template string for your frontend. This is usefull for buttons, labels etc. The following code uses a repeater with the name `strings` has a `key` and a `body` field, the returned array contains the `key` field as, you guess, keys and the `body` field as values: // build custom translations $query = ['strings' => function($page){ return array_column($page->get('strings')->each(['key', 'body']), 'body', 'key'); }]; Multilanguage with default language fallback Using the following setup you can handle multilanguage and return your default language if the requested language does not exist. The url is composed like so: `page/path/{language}/{content-type}` for example: `api/icf/zurich/conference/2019/de/json` // get contenttype and language (or default language if not exists) $lang = wire('languages')->get($input->urlSegment1); if(!$lang instanceof Nullpage){ $user->language = $lang; } else { $lang = $user->language; } // contenttype segment 2 or 1 if language not present $contenttype = $input->urlSegment2 ? $input->urlSegment2 : $input->urlSegment1; if ($contenttype === 'json') { header('Content-type: application/json'); echo $page->pageQueryJson($query); exit(); } Debug The module respects wire('config')->debug. It integrates with TracyDebug. You can override it like so: // turns on debug output no mather what: $modules->get('PageQueryBoss')->debug = true; Todos Make defaults configurable via Backend. How could that be done in style with the default queries? Module in alpha Stage: Subject to change This module is in alpha stage … Query behaviour (especially selecting child-templates, renaming, naming etc) could change2 points
-
Hi, as i'm in south germany...i could provide some kind of experience change and fast entry in all terms and things that are PW specific as kind of briefing or consulting. Also i could provide demoaccess to client pages from me, or examples that show you some kind of Page Builder Systems, since i've build some. On topics like forum integration and other tasks i've to admit that there were much more experienced people around...;) PM me if you are interestet in a call. Best Regards Martin2 points
-
Thanks you both. It's working somewhat inexplicably now with no changes at my end ? I have a feeling a database and server backup which was running was affecting this. That's the only explanation I can think of.2 points
-
Not related to your problem, but I wouldn't recommend inserting "http://www." like that for a few reasons: 1) A site editor could easily add that part themselves - especially if they copy from their browser address bar and then you would have it twice 2) The site may not work with with the www subdomain - unlikely, but possible 3) They might want to link to a different subdomain rather than the www one 4) The site might be https, not http - most likely it would redirect automatically, but it just feels wrong to try to force this2 points
-
ProcessWire 2.4.0 is a pretty old version at this point, so if this is a site you are still involved with development on, it'd be worthwhile to update it, regardless of FormBuilder. You'd want to upgrade it to 2.7.3, and that would be a fine version to keep it with, if you'd like. For some of the older 2.x sites that I rarely work on, I keep them running on 2.7.3. You could also update it to the 3.x version, but that would be a more major update, and you might not necessarily need it for an older site. But you'd want to update to 2.7.3 first, either way. The upgrade instructions for going from 2.4 to 2.7 are here. As always, it's a good idea to test a major update in a development environment before applying to the production site... especially in this case where you'll be jumping 3 major versions (2.4 to 2.7). However, chances are, it'll be a smooth upgrade. Another possibility—I'm not positive that the current version of FormBuilder won't work with 2.4. Just that 2.7.3 is currently the minimum version that I'm testing with. You could always try it and see. But I kind of think upgrading to 2.7.3 is a good idea regardless of what you need to do with FormBuilder.2 points
-
Hi @horst, probably in July I will have time for do it. It's ok if I just export with the download zip button the file?2 points
-
I've put in a feature request for this on GitHub: https://github.com/processwire/processwire-requests/issues/2072 points
-
Nothing is required outside of your module - make your module autoload and use the init() method in your module. The filename is not a property that is saved to the database - it is generated at runtime from the template name, so if you want to set a custom filename then this must be done at runtime. The comment in the Template class is clear about this: @property string $filename Template filename, including path (this is auto-generated from the name, though you may modify it at runtime if it suits your need). #pw-group-files2 points
-
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
-
Hi all! Here it is the first draft of the italian translation of processWire 2.2. All files should be translated, but for clarity, below there are all the files translated. Core /wire/core/Fieldtype.php Inputfield Modules /wire/modules/Inputfield/InputfieldEmail.module /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module /wire/modules/Inputfield/InputfieldPageListSelect/InputfieldPageListSelect.module /wire/modules/Inputfield/InputfieldPageName/InputfieldPageName.module /wire/modules/Inputfield/InputfieldPassword.module /wire/modules/Inputfield/InputfieldSubmit/InputfieldSubmit.module /wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCE.module /wire/modules/Inputfield/InputfieldURL.module /wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module Markup Modules /wire/modules/Markup/MarkupPageFields.module Language Support Modules /wire/modules/LanguageSupport/LanguageSupport.module Process Modules /wire/modules/Process/ProcessForgotPassword.module /wire/modules/Process/ProcessLogin/ProcessLogin.module /wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module /wire/modules/Process/ProcessPageClone.module /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module /wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module /wire/modules/Process/ProcessPageEditLink/ProcessPageEditLink.module /wire/modules/Process/ProcessPageList/ProcessPageList.module /wire/modules/Process/ProcessPageSearch/ProcessPageSearch.module /wire/modules/Process/ProcessPageSort.module /wire/modules/Process/ProcessPageType/ProcessPageType.module /wire/modules/Process/ProcessProfile/ProcessProfile.module /wire/modules/Process/ProcessField/ProcessField.module /wire/modules/Process/ProcessHome.module /wire/modules/Process/ProcessList.module /wire/modules/Process/ProcessModule/ProcessModule.module /wire/modules/Process/ProcessPageTrash.module /wire/modules/Process/ProcessPageView.module /wire/modules/Process/ProcessPermission/ProcessPermission.module /wire/modules/Process/ProcessRole/ProcessRole.module /wire/modules/Process/ProcessTemplate/ProcessTemplate.module /wire/modules/Process/ProcessUser/ProcessUser.module Admin Theme /wire/templates-admin/default.php ================== I will check with more attention the quality of translation in the week-en! If you want to contribute, this is the Github repo: https://github.com/U...ian-processwire Cheers, Alessio1 point
-
We are small German software company and need a Processwire expert helping us to set up a marketing website. Specs: Modern minimalistic design Responsive, Bootstrap 4, Sass/Less compiler, SVG support, multi-lingual Final "style.css" should only include classes, actually used on the site. Clean, lean, minimized html/css output.A We are speed addicts. WP page builder like feature to add components on a page as required (carousels, accordions, testimonials, responsive two columns feature rows, multi-card rows, etc.). Features to allow to create/edit online software documentation (auto toc generation) The marketing website part is just the beginning. Additional parts (shop, newsletter, forum integration, customer backend, etc.) will follow. We are looking for a longtime partner. Preferably in (Southern) Germany. Anyone?1 point
-
3.x dev still works: http://kongondo.github.io/ProcessWireAPIGen/pw3dev/1 point
-
1 point
-
1 point
-
1 point
-
I had Ryan fix this core "bug" a couple of days ago: https://github.com/processwire/processwire/commit/e5e13c190447ce156d3075683ee8a9ca42931904 Can you update the core and let me know if you still have any problems.1 point
-
1 point
-
@neophron if you want a cool example of a onepage site with section as subpage, install and take a look at this profile :1 point
-
Hi @neophron You control the markup yourself: <?php foreach($page->children as $section): ?> <h1><?=$section->title?></h1> <?php endforeach; ?>1 point
-
@flydev, thanks - that's like a relative positioning problem with UiKit (in the tags field); i think i added some jQuery that removes the uikit class from the inputfield, maybe I didn't commit that change yet, will check now.1 point
-
Ok, something is with your "$page->external_link", this quick test works fine here: <?php $page = new stdClass(); $page->external_link = 'processwire.com'; ?> <a href="http://www.<?=$page->external_link?>">Visit site</a> Perhaps $page is not the page you would like to use? What type of field is "external_link"?1 point
-
i installed the module and its working fine! thanks @bernhard the module uses the pw-InputfieldSelect output. is this the reason why the current template is always at top/first place? is there a way to change that? i just want to keep the sorting.1 point
-
The module readme mentions a relevant option: You would set that to false if you don't want entities encoded.1 point
-
PS - Looks like California is getting in on this too: https://slate.com/technology/2018/06/california-just-passed-the-strictest-online-privacy-bill-in-the-country.html1 point
-
Clapped. Also on Medium ? Thanks for your insights and the PageQueryBoss module looks promising. I think I have a use for it in the near future.1 point
-
Something like this can help you, maybe you'll find their payment method: http://omnipay.thephpleague.com/gateways/community/ https://packagist.org/?query=cryptocurrency1 point
-
Like a lot of the stuff coming from PHP's superglobals, using $_SERVER[HTTP_HOST] in that manner actually isn't safe because it comes from request headers, which can be manipulated by the user (a type of user input). $input->httpUrl() on the other hand would be safe, or for just the equivalent of $_SERVER[HTTP_HOST] use $config->httpHost instead (which is validated). If your server uses both http and https (meaning same page accessible via http OR https), then you'll want to point to the https one as your canonical version, like you are doing in your example above. Here's how you might rewrite your example above. If you aren't using URL segments or pagination, then it's also fine to replace $input->url() with $page->url() like you did. The primary difference between $input->url() and $page->url() is that the $input version represents the actual request (including page URL plus URL segments, page numbers, and optionally query string), rather than just the static URL of the $page that it loaded. <link rel="canonical" href="<?php echo "https://$config->httpHost" . $input->url(); ?>" />1 point
-
Hey, sorry. So I've looked into this for you and I was completely wrong. To explain - hooks are functions that run before or after another function such as Page::save(). So return false; will only return false on the extended function and not the save() function itself so the save will still happen. Actually the solution is much, much simpler. In your ready.php all you need is <?php if(wire('user')->hasRole('demo-user')) { wire('config')->demo = true; } ?> That's it ?1 point
-
Not sure, i doubt it, but i use Colorsnapper on Mac which lets me pick colors from anywhere on the screen and then i paste the value into the colorpicker field hex1 point
-
You don't need an extension, just add vscode://file/%file:%line to tracy. https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls1 point
-
If you do not assign a title the autogenerated ID (Inputfield) will be taken. $inputfields->attr('title', 'Weird name'); To put the Inputfields (Tabs) in the right order you could use InputfieldWrapper::insertBefore() or InputfieldWrapper::insertAfter() instead of InputfieldWrapper::add(). Unfortunately this doesn't work in case of ProcessPageEdit. To get it working you need to add another hook to ProcessPageEdit::getTabs() The following code snippet should work. Place it in your /site/ready.php wire()->addHookAfter('ProcessPageEdit::buildForm', function ($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $inputfields->attr('title', 'Weird Name'); $inputfields->attr('name+id', 'WeirdTabNameAndId'); // we need both unique ID and Name $markup = wire()->modules->get('InputfieldMarkup'); $markup->label = 'Custom Lable'; $markup->value = '<p>Just a placeholder for any custom markup</p>'; $inputfields->add($markup); $pageEditTab = $form->find('id=ProcessPageEditContent')->first(); $form->insertAfter($inputfields, $pageEditTab); // inserting in the right place is not enough to set the tab order // we need the following hook wire()->addHookAfter('ProcessPageEdit::getTabs', function ($event) { $event->return = array_merge( array_slice($event->return, 0, 1, true), array('WeirdTabNameAndId' => __('Weird Name')), // should be identical to the weird name/title above array_slice($event->return, 1, null, true) ); }); $event->return = $form; } });1 point
-
dropped a first prototype onto github some minutes ago. very early stage, developed and barely tested under PW 3.0.9. Reuses some stylesheets from CKEditor, so be sure you have installed that as well, if you want to test it. https://github.com/nikosch/ProcessWireImageLink [edit] not sure, if this works in other versions of PW and how it behaves with additional image processors. But the code is no rocket science, so the chances are not too bad1 point