Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. 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(); }); } });
  2. 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 !)
  3. 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.
  4. Using this Module and works great ! Big thank you !
  5. 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
  6. 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)
  7. 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);
  8. @benbyf, you just have to start... We can help when you're stuck.
  9. Remove post: SSB3YW50IHRvIGdpdmUgR29TdGF0cyBhbmFseXRpY3MgYSB0cnkuIERvZXMgYW55b25lIGhhdmUgZXhwZXJpZW5jZSBHb1N0YXRzIGFuYWx5dGljcyA/IEkgaGF2ZSB1c2VkIHRoYXQgZm9yIG9mIG15IHJlY2lwZSBzaXRlICYgSSBhbSBpbXByZXNzZWQgd2l0aCB0aGlzIHRvb2wuIEl0IGhhdmUgYXdlc29tZSB0cmFja2luZyBmdW5jdXRpb25hbGl0eSwgbW9zdCBJIGFtIGltcHJlc3NlZCBmcm9tIEdVSSBvZiB0b29sLg==
  10. Moved your site? If yes, edit your database settings is /site/config.php
  11. I don't know anything about that module, but do you wait until the DOM is loaded before calling the script?
  12. 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.
  13. 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; }
  14. When you name your file ProcessPageEditHide.css it will be loaded when ProcessPageEdit is active and selected in the settings.
  15. 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!"); } });
  16. Numbers aren't that harmful except 007
  17. 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.
  18. 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; } }
  19. 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);
  20. instant fix... you're the best
  21. 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.
  22. Nice find @Teppo. Big smile on my face here....
×
×
  • Create New...