-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
Refresh listerPro after closing/saving the modal: (You need to enable 'Additional javascript config data' in the settings) $(function () { if (config.AdminCustomFiles.process === 'ProcessPageListerPro') { $(document).on('dialogbeforeclose', '.pw-modal-window', function() { $("#_ProcessListerRefreshTab").click(); }); } });
-
Different templates-folder for different users/roles?
Martijn Geerts replied to pideluxe's topic in Wishlist & Roadmap
These things should be set very, very early in 'load' process of ProcessWire. Manage from back-end, don't know if it's even possible. (Please proof that I'm wrong !) -
Different templates-folder for different users/roles?
Martijn Geerts replied to pideluxe's topic in Wishlist & Roadmap
Raymond Geerts, has pointed me a way to swap templates folder based on the hostname. (His post is somewhere here on the forum.) You need to place this code in /site/config.inc Here's my variation: /** * Switch ProcessWire templates directory on $_SERVER['HTTP_HOST']. Type the * Hostname as key and the name of the new templates folder as value. * */ $config->templates = array( 'sub.domain.dev' => 'templates-dev', // domain => templates folder name ); if (isset($_SERVER['HTTP_HOST']) && isset($config->templates[$_SERVER['HTTP_HOST']], $config->templates)) { foreach ($config->templates as $host => $folder) { if ($_SERVER['HTTP_HOST'] === $host) { $config->urls->templates = "/site/" . $folder . "/"; $config->paths->templates = dirname(__DIR__) . $config->urls->templates; } } } Here is Raymond's post. -
Development: FieldtypeFloat - FieldtypeDecimal
Martijn Geerts replied to kixe's topic in Modules/Plugins
Using this Module and works great ! Big thank you ! -
yes
-
Complicated Page Query (page references, etc.)
Martijn Geerts replied to Jonathan Lahijani's topic in General Support
A little bit more data will simplify search queries and results in less overhead. And for end users it's convenient to be able to edit on 2 places. ps, when you discover a bug, please report -
Complicated Page Query (page references, etc.)
Martijn Geerts replied to Jonathan Lahijani's topic in General Support
Both ways make the most sense Did that today with groups and products, looks like it works great. You need to adjust names and stuff and you should be up & running (bidirectional) -
Posting and getting may sound more difficult then Ryan has made it for us. To give you a simple example that extends Jan Romero's post: $http = new WireHttp; $request = array( 'public-key' => 'xyx1234_what-instagram-wants', 'just-a-key' => 'Just some value you want to add to your get request', ); $data = $http->get('http://instagram.com/request/some/partt', $request); // data should have data coming from instagram var_dump($data);
-
@benbyf, you just have to start... We can help when you're stuck.
-
Remove post: SSB3YW50IHRvIGdpdmUgR29TdGF0cyBhbmFseXRpY3MgYSB0cnkuIERvZXMgYW55b25lIGhhdmUgZXhwZXJpZW5jZSBHb1N0YXRzIGFuYWx5dGljcyA/IEkgaGF2ZSB1c2VkIHRoYXQgZm9yIG9mIG15IHJlY2lwZSBzaXRlICYgSSBhbSBpbXByZXNzZWQgd2l0aCB0aGlzIHRvb2wuIEl0IGhhdmUgYXdlc29tZSB0cmFja2luZyBmdW5jdXRpb25hbGl0eSwgbW9zdCBJIGFtIGltcHJlc3NlZCBmcm9tIEdVSSBvZiB0b29sLg==
-
Error: Exception: SQLSTATE[HY000] [1045] Access denied for user
Martijn Geerts replied to Manol's topic in General Support
Moved your site? If yes, edit your database settings is /site/config.php -
Call to undefined method DirectoryIterator::getExtension()
Martijn Geerts replied to Outcydaz's topic in General Support
What version of PHP are you running ? -
I don't know anything about that module, but do you wait until the DOM is loaded before calling the script?
-
Money is relative and mostly in perspective of what they can spend. I feel my wallet when refuelling the car others don't care to refuel an oil tanker.
-
What I would do in this instance: Add a class when the requirements are met. For example, I would add the class .hide-me and in the file: .hide-me { position: absolute; Margin-left: -9999em; height: 0; width: 0; }
-
When you name your file ProcessPageEditHide.css it will be loaded when ProcessPageEdit is active and selected in the settings.
-
The process is the process that is running. (Admin pages have this process assigned on the page) The roles are the roles the logged-in user has. Admin theme should not matter. // not tested, but should give a clue.... $(function () { var customrole = 'editor', info = config.AdminCustomFiles; if (info.user.roles[customrole].length) { $('#element').addClass('hide-me'); console.log('Do your stuff'); } else { console.log("Don't do it!"); } });
-
And the other end: Y2K38
-
Numbers aren't that harmful except 007
-
Hiding language input fields based on role
Martijn Geerts replied to Beluga's topic in Multi-Language Support
There's no build-in mechanism to do what you want I guess. The easiest route I see is with AdminCustomFiles. I would install that module, check the checkbox for config data. Then build your logic with the config.AdminCustomFiles object. -
You could hook into ProcessPageEdit::loadPage and set the wanted fields. class EmptyFields extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Empty Fields', 'version' => 1, 'summary' => 'Set default title if empty.', 'singular' => true, 'autoload' => 'template=admin', ); } public function init() { $this->addHookAfter('ProcessPageEdit::loadPage', $this, 'afterLoadPage'); } public function afterLoadPage(HookEvent $event) { /* Here you could make your own logic. I've done this ones with a table field. fields in the table were: template-name, field-name and value. Then you can get the right value for your page on the row where template and field-name match. */ $page = $event->return; $page->title = $page->title == '' ? date("Y-m-d H:i:s") : $page->title; } }
-
Using placeholder in textfield (ckeditor)
Martijn Geerts replied to tires's topic in General Support
I'm not fully understand what you want to do with your pagefield. But I do think a simple str_replace can do alot what you want. <?php $placeholders = array(); // loop through your page field, and create an array with your replacements. foreach ($page->multipages as $p) { // create dynamic keys => values, where the key is the url of a page $placeholders['{' . $p->url . '}'] = $p->theheadline; } // Here {/somepage/} will be replaced with the theheadline of the /somepages/ page $body = 'Vestibulum id ligula {/somepage/} porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec id elit non mi porta gravida at eget metus. Donec id elit non mi porta gravida at eget metus. Vestibulum id ligula porta felis euismod semper.'; echo str_replace(array_keys($placeholders), $placeholders, $body); -
instant fix... you're the best
-
Hi Adrian, found a little issue on line 111. When the page has no title, a fatal error is thrown, Never the less, thanks lot the module.
-
Nice find @Teppo. Big smile on my face here....