-
Posts
1,329 -
Joined
-
Last visited
-
Days Won
61
Everything posted by BitPoet
-
A quick test with InputfieldTinyMCE left the ­ intact in the source code view.
-
Getting index from page images array in for loop doesn't work
BitPoet replied to Tyssen's topic in API & Templates
That's because it's not a regular array but a PageImages object. If you inspect $i in your first example, you'll see that it contains the image filename, not a numeric index. To get a plain array without the filenames as keys, use its inherited getValues() method. foreach ($page->images->getValues() as $i => $image): -
For what it's worth, it makes sense to have the capability to test drive new template files, so I rolled a little module. This adds a field to the template configuration for an alternative template file only used for editors. https://github.com/BitPoet/TemplateTester
-
A lot depends on the exact structure of the site (e.g. if you use automatic append of a generic template file) and at what point you introduce your code. If you're already inside a template's php code, changes to altFilename won't do anything. You'd have to do that before rendering of the page has started, e.g. through a hook in site/ready.php: <?php namespace ProcessWire; /* wire()->addHookBefore('Page::render', function(HookEvent $event) { $page = $event->object; if($page->template->name == 'your-template-you-want-to-change' && $page->editable()) { $page->template->altFilename = 'wireframe.php'; } } */ Actually, I should have given that code a test spin before posting. The correct hook would be to ProcessPageView::execute.
-
Sure. In your template file (or auto append file, here for _main.php), just include the correct template according to the user's login status. <?php namespace ProcessWire; if($user->isGuest()) include('_main_regular.php'); else include('_main_wireframe.php');
-
Actually, it does (at least everything but fatal errors). That's one of the reasons (besides information disclosure) you shouldn't use debug mode on a production site.
-
Glad you're making progress. If only the homepage works, it's usually an issue with RewriteEngine support or RewriteBase not being set correctly in .htaccess (or a missing .htaccess). Make sure you didn't miss any files starting with a "." in the upload.
-
Since InputfieldTinyMCE appears to make huge steps towards becoming a stable replacement for CKEditor and TinyMCE comes with a native autocomplete API, I just had to try my hands at migrating the autocomplete module I had built for InputfieldCKEditor. Lo and behold, it went even easier than I had hoped. So here - mind you, still very alpha - is my autocomplete module for the new TinyMCE input field. Since I may still introduce breaking changes while things become stable, it will only be available at GitHub for now. Autocompleter for InputfieldTinyMCE What does it do? Autocompleters work like the mention plugin in this forum. You type a "trigger" character (or characters) followed by some letters, and a list of possible results pops up, from which you can choose. InlineCompleteTinyMCE comes with three different autocompleters (called "actions" in the context of this module): Pages: you can configure a selector, just like when you search for pages in the ProcessWire backend. You can search for title, name or any field you would like. Like every action, it allows you to specify templates for the label and the HTML/text to insert. Users: this is the equivalent to the form mention. Type an "@" sign followed by the start of a user name, and it inserts a link to that user. If you have added an image field to the user template, you can display that in the selection popup too. Hanna Code: just type the opening tag ("[[" by default) for your Hanna code and any letter, and the module will look for all codes starting with those letters. You can easily implement your own action modules too. Just inherit from InlineCompleteTinyMCEAction and add the code for a few methods. Enabling Actions For every installed action, you will find a checkbox on the "Input" tab when you configure a field. Configuration for Actions Once you have enabled the action, more configuration options become visible. The exact options depend on the action itself, but you usually have a label template and a value template. You can use placeholders in both. Actions in Action This is what it looks like when used: Compatiblity The module has been tested with InputfieldTinyMCE v6.0.6 both in standalone and inline mode. Lazy loading the standalone editor is also supported. Outlook There's still a bit work waiting for me, from cleaning up some code, over making the Pages action support multiple autocompleters with different triggers and selectors, to adding a lot of documentation. Nevertheless, I'd be happy to get some feedback.
-
A few more things come mind: check if really all files have been uploaded, as we have seen strange errors with incomplete uploads before. Make sure that uploading to OVH didn't mess with character encodings, and verify that the configured PHP version is actually active (e.g. by placing a small script containing just <?php phpinfo(); ?> in the web root.
-
I've only ever seen that error message in the context of IMAP, not SMTP. Are you sure your WireMailSMTP configuration is correct? Or are you accessing some IMAP mailbox earlier in the code?
-
This reads like a namespace issue, which FileCompiler should take care of. Make sure that site/assets (and of course also the directories and files below) is writable by the server. Best clear out the directories in site/assets/cache, then any permission issues should become obvious quickly.
-
I'm really happy with InputfieldTinyMCE so far. And as threatened to in reply to an earlier core updates post, I took a stab at migrating my autocomplete module over from InputfieldCKEditor. All in all, it was quite a pleasant experience and the JS side was really straight forward. The change also involved a lot of refactoring, and in the aftermath of that there's still a good bit of house cleaning to do, but for anybody willing to toy around with it, there's an alpha release of InlineCompleteTinyMCE on GitHub. A snapshot of InlineCompleteTinyMCEActionUsers in action: And the corresponding configuration in the field's "Input" tab (added to the TinyMCE config section): I haven't tested it with lazy loading or the inline editor yet.
- 6 replies
-
- 15
-
-
You could call $modules->getModuleInfo('all', ['minify' => false]) and iterate over the results. Each entry has a "core" property and an "installed" property you can check.
-
Have you tried changing FollowSymlinks to SymLinksifOwnerMatch in .htaccess (it's explained in the comments in section 1. Apache Options)? You should probably even be fine with just commenting out the line in a standard PW setup, so I'd try that first.
-
Weekly update – 28 October 2022 – TinyMCE Inputfield released
BitPoet replied to ryan's topic in News & Announcements
That's great. Can't wait to find a bit of spare time to take it on a test drive. Cool that the module is already on TinyMCE 6.2, as that release comes with a more flexible autocomplete api. This is going to shave a lot of (or almost all of the) JS code from my autocomplete module. -
Get a value's fieldname inside a renderField file.
BitPoet replied to GavJMF's topic in API & Templates
Have you looked at $field inside the field template file? -
That's what the regular PageReference field (FieldtypePage) is for. Add a new Page Reference field to your template On the Details tab, select "Multiple pages (PageArray)" as the value type On the Input tab, select an Inputfield that supports multiple pages (e.g. AsmSelect) If the dropdown shouldn't show all pages in the site, add limitations in the "Selectable pages" section
-
Bug? Upgrade method not being called in modules
BitPoet replied to JayGee's topic in Module/Plugin Development
It should work if you define the upgrade method as hookable (___upgrade). -
A bit of a stab in the dark, but maybe an IPV6 issue? I can see that the test2 host has an IPV6 address while the other does not.
-
Might be from an unsuccessful curl request (stuff like incompatible cipher suites, untrusted certificate etc.). Have you checked $http->getError()?
-
Sounds like an incomplete upload (with FieldtypeFile.module being an older version that lacks those method implementations, otherwise FieldtypeImage would inherit them).
-
Hi @Ivan Gretsky, I will at one point for sure, but that will be late in the year. I‘m currently hiking across the U.S. and won‘t get my hands on a computer until October.