-
Posts
5,034 -
Joined
-
Days Won
340
Everything posted by Robin S
-
Module Module: RuntimeMarkup Fieldtype & Inputfield
Robin S replied to kongondo's topic in Modules/Plugins
@psy, in theory you don't need any sort of special module to put runtime markup into a field. Instead just add a Markup field to the form and then hook before the form is rendered to put whatever markup you want into it. Having said that, there are some oddities with Markup fields in FormBuilder. I raised some questions that Ryan answered here: But I still had some other problems (I can't remember exactly what they were now) that I ended up resolving by making a clone of the core InputfieldMarkup module with some minor changes. I've attached the resulting InputfieldCustomMarkup module. If you install this module and enable it for use in FormBuilder then you can use it the same as a Markup field but without the snags. InputfieldCustomMarkup.zip -
Thanks, I should have tested that. Fixed now in v0.1.1 Good idea, I've added this in v0.1.1
- 3 replies
-
- 3
-
-
- tags
- thumbnails
-
(and 2 more)
Tagged with:
-
A new module that should suit your needs:
-
Displays image tags overlaid on the thumbnail using customisable colours. This makes it easier to see which images have which tags without needing to open the edit pane for individual images or changing to the list view. Screenshot Usage Enable tags for one or more image fields. Install the Image Thumbnail Tags module. Optionally configure colours for any of your tags. https://github.com/Toutouwai/ImageThumbnailTags https://modules.processwire.com/modules/image-thumbnail-tags/
- 3 replies
-
- 15
-
-
- tags
- thumbnails
-
(and 2 more)
Tagged with:
-
I'm using the very latest v5d dev version, shared by Ryan here: https://processwire.com/talk/topic/21581-repeater-matrix-v5/?do=findComment&comment=199110 But Ryan addressed that version to you so maybe you are already using it? If you're not try updating to it because this topic makes me think there might have been a problem with CKEditor fields and Repeater Matrix: https://processwire.com/talk/topic/22029-ckeditor-field-context-per-matrix-type/
-
@schwarzdesign, I can't reproduce that issue - the toolbar dropdown appears inside Repeater Matrix fields and nested Repeater Matrix fields. Double-check that you have included "HannaDropdown" in the toolbar settings for the CKEditor field.
-
"editable_pages" is a Page Reference field that is created by this module. Go to that field's settings and on the "Details" tab there is a setting "Allow unpublished pages?" - tick that checkbox.
-
You want browsers to reload the CSS any time that it changes, instead of going to the browser cache. Appending a query string to the CSS URL that changes every time the CSS changes is a reliable way to achieve this. You can see an example of this approach in the PW admin, where the file modified timestamp is used in the query string:
-
I have my doubts about how effective that strategy will be, but you have a few options: 1. Create a PW template and page that outputs the CSS. Use a "text/css" content-type header, either using the "Content-Type" select on the Files tab of the template, or by using header(). header('content-type: text/css; charset: UTF-8'); Add this page to your markup in a <link> tag: <link rel="stylesheet" type="text/css" href="/path/to/page/"> 2. Similar to the above, but rather than create a template and page instead create a PHP file in the site root (PHP files are blocked inside /site/) that bootstraps ProcessWire. 3. Use $files->filePutContents() to actually write a CSS file that you load in your markup. In all of these cases you will probably want to use a cache-busting query string based on the time the CSS was last modified.
-
A new module that hasn't had a lot of testing yet. Please do your own testing before deploying on any production website. Custom Paths Allows any page to have a custom path/URL. Note: Custom Paths is incompatible with the core LanguageSupportPageNames module. I have no experience working with LanguageSupportPageNames or multi-language sites in general so I'm not in a position to work out if a fix is possible. If anyone with multi-language experience can contribute a fix it would be much appreciated! Screenshot Usage The module creates a field named custom_path on install. Add the custom_path field to the template of any page you want to set a custom path for. Whatever path is entered into this field determines the path and URL of the page ($page->path and $page->url). Page numbers and URL segments are supported if these are enabled for the template, and previous custom paths are managed by PagePathHistory if that module is installed. The custom_path field appears on the Settings tab in Page Edit by default but there is an option in the module configuration to disable this if you want to position the field among the other template fields. If the custom_path field is populated for a page it should be a path that is relative to the site root and that starts with a forward slash. The module prevents the same custom path being set for more than one page. The custom_path value takes precedence over any ProcessWire path. You can even override the Home page by setting a custom path of "/" for a page. It is highly recommended to set access controls on the custom_path field so that only privileged roles can edit it: superuser-only is recommended. It is up to the user to set and maintain suitable custom paths for any pages where the module is in use. Make sure your custom paths are compatible with ProcessWire's $config and .htaccess settings, and if you are basing the custom path on the names of parent pages you will probably want to have a strategy for updating custom paths if parent pages are renamed or moved. Example hooks to Pages::saveReady You might want to use a Pages::saveReady hook to automatically set the custom path for some pages. Below are a couple of examples. 1. In this example the start of the custom path is fixed but the end of the path will update dynamically according to the name of the page: $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'my_template') { $page->custom_path = "/some-custom/path-segments/$page->name/"; } }); 2. The Custom Paths module adds a new Page::realPath method/property that can be used to get the "real" ProcessWire path to a page that might have a custom path set. In this example the custom path for news items is derived from the real ProcessWire path but a parent named "news-items" is removed: $pages->addHookAfter('saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'news_item') { $page->custom_path = str_replace('/news-items/', '/', $page->realPath); } }); Caveats The custom paths will be used automatically for links created in CKEditor fields, but if you have the "link abstraction" option enabled for CKEditor fields (Details > Markup/HTML (Content Type) > HTML Options) then you will see notices from MarkupQA warning you that it is unable to resolve the links. Installation Install the Custom Paths module. Uninstallation The custom_path field is not automatically deleted when the module is uninstalled. You can delete it manually if the field is no longer needed. https://github.com/Toutouwai/CustomPaths https://modules.processwire.com/modules/custom-paths/
-
Release date: 7 October 2016 https://processwire.com/blog/posts/processwire-3.0.36-and-looking-forward/ This warning started in PHP 7.2, release date: 30 November 2017 https://en.wikipedia.org/wiki/PHP#Release_history PHP is adding and deprecating features all the time. Not just a ProcessWire thing, but in general you don't want to run PHP software on a PHP version that didn't exist when that software was released.
-
Yes, good tip - thanks. Also note that if unpublished pages are to be included then the Page Reference fields in question would need to be configured to allow them, because by default they are not.
-
A couple of issues I can see there. You need to set the $event->return instead of returning a value. And if you are hooking before and replacing a method with your own code then you need $event->replace = true. See Ryan's example in the topic I linked to. But in your case a simpler approach could be this (note that this is hooking after because it is modifying the $event->return): $wire->addHookAfter('Page::path', function(HookEvent $event) { $page = $event->object; if($page->rootParent->template != '_site') return; $event->return = str_replace('/' . $page->rootParent->name, '', $event->return); });
-
@jonatan, what you're describing doesn't relate to the Connect Page Fields module - this module doesn't get involved with whatever inputfield you have chosen to select pages with. Maybe take a look at the Inputfield Selectize module - it shows an example with thumbnails in the readme.
-
You hook Page::path - see Ryan's case study example: You might be reinventing the wheel... https://processwire.com/docs/more/multi-site-support/ https://github.com/somatonic/Multisite/
-
Sweet! How about integrating lite-vimeo-embed too? Then the module could be a drop-in replacement for TextformatterVideoEmbed. ?
-
I actually ended up writing my own backup script because I wanted the backup to run by cron job at a fixed time rather than have the unpredictability inherent in LazyCron. But in terms of this module my vote would go for having CronjobDatabaseBackup identify the backups that it creates either by filename prefix or something distinctive in the Description as per @horst's suggestion. Then the backups can be safely stored in /site/assets/backups/database/ where they can be viewed and restored via ProcessDatabaseBackups and there is no requirement to use a "file protection string" to protect backups not created by CronjobDatabaseBackup.
-
FYI, the core has built-in support for relative time strings: https://processwire.com/api/ref/wire-date-time/relative-time-str/
-
Just what is shown in the Implementation field: echo $page->comments->renderAll(); I suggest testing a Comments field on a clean installation of PW so you can determine that it does indeed work and then you can focus in on what might be different on your other site.
-
@kixe, I feel that the settings "Maximum number of backups" and "Remove backups older than" should only apply to backups created by CronjobDatabaseBackup. If the user has made manual backups, or backups have been made by a different module, then CronjobDatabaseBackup should never delete those backups. What do you think?
-
I think custom database tables and SQL queries would be the way to go. This is a good read on working with hierarchies in MySQL: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
-
You are posting in the support thread for the third-party Image Extra module. This is already reported in the GitHub issues repo: https://github.com/processwire/processwire-issues/issues/1070
-
To reproduce, put an input element in your template that is not within a form. <input type="text" value="someone@domain.com"> It's valid to use inputs, textareas, etc outside of a form element.
-
Thanks for the reminder - I just tried this for the first time and it works well. I still think it would be a nice feature to add to Duplicator because it's more efficient time-wise to download all the images you need in one hit while you have a coffee rather than page by page as you edit. Plus I reckon people will find other use cases for selectively including page files in a backup.
-
Big, big thanks @adrian for all your ongoing work on Tracy Debugger - it just gets better and better!