Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates     

  1. Today
  2. Rob Coldwell

    Hi. Nice module! Exactly what I was looking for to make my main nav-bar conditional (if desktop, hovering drops-down my menu but clicking goes to page, if tablet etc., clicking just drops-down). Perfect! Thanks. echo "<li class='dropdown'><a href='". ($config->mobileDetect->deviceType == 'desktop' ? $child->url : '#') ."' data-hover='dropdown'>{$child->title}<b class='caret'></b></a>";
  3. Hi, I'm building a site where users can edit and update their user profile in the admin area but are not allowed to see/edit any other part of the admin (e.g. pages). (Note: These profiles have a different template and a different parent than the normal users. see: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users) In these profiles, I want to use multilanguage fields. But if a user only has profile-edit permission, he can't save these fields. To do this, he needs page-edit and page-edit-lang permissions. These permissions also let him see the page tree, which he shouldn't see. Is there any way to have multilanguage fields in a profile without page-edit-permissions? Single language fields work fine and without issues. Thanks!
  4. Michkael

    I am very sorry for the ignorance but I don't know where to put the CSS file. CSS admin goes here -> /* /site/templates/styles/admin.css */ JS here -> // /site/templates/scripts/cke.js and the CSS CKEditor where should it go? The other link you pasted says you have to put the styles in : mystyles:/site/modules/InputfieldCKEditor/mystyles.js could you please explain me the difference? For the module fluid image it adds aconfigurable CSS class, but where? Thank you for your help @szabesz
  5. bernhard

    I've used Nette image functions for that once I needed it: https://doc.nette.org/en/2.4/images#toc-image-modification but your linked library looks more advanced
  6. spackmat

    I came to the same question as @adrian: The FieldtypeVerifiedURL is nice, but without any assist not quite comfy for our editors. How can a combination of FieldtypeVerifiedURL and FieldtypeAssistedURL achieved? Edit: I'll open a Thread on this in the Profields forum.
  7. pwFoo

    Hi, module isn't acctive / maintained. Could $template be the problem? Maybe you should use "$this->templates->get" or "wire('templates')" inside of a module. And it should be "templates"?
  8. PWaddict

    I started working on a module that will use exclusively the Esri Geocoding. Since you're using the Leaflet Control Geocoder on your module that supports various geocoders, you should update it to let the user select which one they want to use by supplying their API key if the selected geocoder requires it.
  9. Yesterday
  10. Here is the description of Pageimages class ProcessWire Pageimages Pageimages are a collection of Pageimage objects. Typically a Pageimages object will be associated with a specific field attached to a Page. There may be multiple instances of Pageimages attached to a given Page (depending on what fields are in it's fieldgroup). https://processwire.com/apigen/class-Pageimages.html
  11. I will use this until I find a better solution $value = $s->first(); while ($value) { if($value->start==50){ //just an example to select an element $s->insertAfter($insert, $value); } echo $value.'<br>'; $value = $s->getNext($value); } I would like it more to use foreach, but for that I have to modify the iterator class (I believe)
  12. cstevensjr

    I just saw this. I was able to install on a new website using the instructions detailed by @darrenc. Thanks
  13. Thanks. I'm not completely sure if I read your question right. The screencap above shows the front end form (it's just included in the backend interface on the preview tab, but it's the same as if you embed your form anywhere on the frontend).
  14. dynweb

    https://github.com/processwire/processwire-issues/issues/767
  15. benbyf

    https://www.dropbox.com/s/tl5zgx9h7iormf8/Screenshot 2018-12-10 13.53.46.png?dl=0 Just seen this on the instagram developer portal. I had a quick play with the facebook API explorer but couldn't get it to work as wanted (just display another user's profile image). Think we'll need to get going with this as instagram is stopping support for it's own API
  16. How can i convert a float field to decimal , decimal does not show up in select list for change fieldtype ?
  17. kongondo

    Hi @xportde, It would be and it doesn't need to wait for the future. It is already here . With the new version (announcement imminent), you can add as many fields as you want to your respective Media Manager templates. Let's say you want a URL for your images. All you would need is to: Add a URL field (in this example, called link) to the Media Manager image template (media-manager-image). If not accessing your Media Manager Library directly, create a Media Manager Field (let's call it albums) and add it to your page's template, say basic-page. In the Media Manager Field (albums) settings, enable 'Allow users to edit selected media'. Edit a page using basic-page template. Add images to the field Hover over an image and click the Edit link. Edit your link field to add your URL. In your template file, you can access your URL like this: $albums = $page->albums; $out = '<div>'; $out .= $albums->each(function($m) { if($m->typeLabel !='image') return; $thumb = $m->media->height(260); $img = "<img src='{$thumb->url}' alt='{$m->media->description}' height='130'>"; $o = "<div><a href='$m->links'>$img</a></div>"; return $o; }); $out .= '</div>'; // OR: Using foreach /* $out = '<div>'; foreach ($albums as $a) { if($m->typeLabel !='image') return; $thumb = $m->media->height(260); $img = "<img src='{$thumb->url}' alt='{$m->media->description}' height='130'>"; $out .= "<div><a href='$m->links'>$img</a></div>"; $out .= $m->body; } $out .= '</div>'; */ echo $out; And that's it. Any field you add to your Media Manager template is available as $m->name_of_field, where $m is an instance of MediaManager field as per the example above. More examples in my next (eventual) post(s). I tried to make a video, or an animated GIF, even a simple screen capture to show you what I mean but everything failed! Lots of artefacts, etc. I've recently moved to Linux, so still finding my way round.
  18. Thanks! It was as it's a pretty simple extension (source below). I followed the VS Code official docs: https://code.visualstudio.com/docs/extensions/example-hello-world and looked at the examples they gave. // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below const vscode = require('vscode'); // this method is called when your extension is activated // your extension is activated the very first time the command is executed function activate(context) { // Use the console to output diagnostic information (console.log) and errors (console.error) // This line of code will only be executed once when your extension is activated console.log('Congratulations, your extension "whichthemeisthat" is now active!'); // The command has been defined in the package.json file // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json let disposable = vscode.commands.registerCommand('extension.whichThemeIsThat', function () { // The code you place here will be executed every time your command is executed // context.subscriptions.push(disposable); // create a new status bar item that we can now manage myStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); context.subscriptions.push(myStatusBarItem); myStatusBarItem.show(); updateStatusBarItem(); // register some listener that make sure the status bar // item always up-to-date context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(updateStatusBarItem)); context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(updateStatusBarItem)); }); } function updateStatusBarItem() { const theme = vscode.workspace.getConfiguration().get('workbench.colorTheme'); const font = vscode.workspace.getConfiguration().get('editor.fontFamily'); myStatusBarItem.text = '$(eye) Theme: ' + theme + ' + ' + 'Font: ' + font; } exports.activate = activate; // this method is called when your extension is deactivated function deactivate() { } exports.deactivate = deactivate;
  19. joshua

    I updated some dependencies and bugs (e.g. the php 7.2 bug with each() ) in this push request.
  20. cb2004

    That done the trick, I had to turn off cleaning for things like ?utm_source=X&utm_source=Y. What caught me out here was page:1000{all} didn't work, fine once I realised though.
  21. suntrop

    Hi OLSA, thanks for your code. On the second look, I think this can work for me. But this one focuses on the posts again, not the groups. I think I found a fairly simple approach, but haven't tested thoroughly $i = 0; foreach ($user->groups() as $group) { $post = $group->find('template=posting, sort=-created, limit=1')->first(); $user->groups()->eq($i)->data('latest', $post->created); $i++; } // later I can foreach($user->groups()->sort('-latest') as $group) {…} I am just adding a new property 'latest' with the timestamp and can sort my groups by this new property later where I output my groups.
  22. jsilmarovi

    Hey bernhard. I'll try this one. Thanks for the tip
  23. Hello @bernhard ragarding my other post: I'm starting the port of my MODX add-on GoodNews - a integrated group and newsletter mailing system - to Processwire. The add-on will be a full featured app which willl have custom admin pages, modules for sending mails, and so on ... As I'm just scratching the surface of Processwire, I can't say which module types I will need.
  24. Our sending engine is capable of running multiple parallel send-processes. Therefore the time needed to send out such number of mails can be drastically reduced (of course if your sever can handle the load). I already had a look at the implementation of WireMail. I'll definitely use existing modules as dependencies wherever applicable.
  25. Last week
  26. teppo

    $config->httpHost should return current domain (if it's included in the httpHosts setting) or the first domain from said setting if no match was found. Here's the related code for reference: https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/wire/core/ProcessWire.php#L308-L323. If you're accessing your site with the dev domain and this domain is included in the httpHosts setting, that should be what this method returns. If not, I'd make sure that related settings are properly configured, and that your server works as expected (particularly in terms of SERVER_NAME and/or HTTP_HOST). I'm not entirely sure what you're referring to with the "edit multiple URLs in the code" part, but generally speaking I'd recommend using relative paths etc. instead of fully qualified domains. This way it doesn't really matter which domain you access your site from. It's possible that you were actually referring to something else, so feel free to clarify this part Edit: actually there's one more thing to keep in mind here, which is that ProcessWire prefers the ServerName value from the Apache VirtualHost block ($_SERVER['SERVER_NAME']) over the host header provided by the browser ($_SERVER['HTTP_HOST']) when determining httpHost. ServerName is used at least if Apache "UseCanonicalName" setting is "on", but this behaviour may apparently vary between different Apache versions. In this case the solution would be either disabling the UseCanonicalName setting, or creating separate VirtualHost blocks for all domains you want to use with ProcessWire.
  27. netcarver

    Hi All, I realise there is work that still needs doing on this module. This includes supporting a full set of selector operators and publishing the support for use in Form Builder. Unfortunately I'm buried deep in some non-PW development at the moment and can't put the time in that's needed, this also explains my absence from the forum for the past month. It is on my radar though and I'll get back to it when I can - probably in late Jan.
  28. OLSA

    @Leftfield I am happy that you solved your problem ;). Maybe you can consider and few other options to get granularity or selection inside different types of featured posts (favorites). Option 1) Using Autocomplete page reference field Create and place Page Autocomplete field on some template (eg. on home or on some "widget" template). As example, if field "featured" is on Home page: $fav = $homepage->featured->eq(0); // or $homepage->featured->first $favs = $homepage->featured->slice(1); // skip first and get others $cards = $pages->find("template=blog-post, id!={$homepage->featured}"); Option 2) Get pages by priority levels Currently you are going with 3 check fields to get "sticky", "fav", and "favs". There is option how to get the same (checkboxes/radio) with only 1 field, but here I will try to describe (something different) how you can get "granularity" inside featured posts also using 1 field. Create integer field, and as example, set min to 0, and max to 3, and place it on your "blog-post" template. Later, in your code, it's very easy to get desired post by priority level. $fav = $pages->findOne('template=blog-post, priority=3, sort=-blog_date'); $favs = $pages->find('template=blog-post, priority=2, limit=2, sort=-blog_date'); // etc... $all_others = $pages->find('template=blog-post, priority<1, sort=-blog_date'); With this you can "describe the importance" of some post, and later, if it's needed, you can extend that with more levels without additional fields (changing only integer field range). Also with this option you can order posts by priority (sort=-priority). Option 3) Post priority levels with the addition of hooks (need to test) Here is option (for testing) to get on the website only 1 post with priority level 3, and later when someone add new page with the same level (3), previously post automatically would go to level 2, and so on. Here is working example using hooks, but please note that in some situation maybe could not works as expected. Before using this hook, you need to create "priority" field (option 2) and set your template inside hook part. Place this hook inside site/ready.php. // site/ready.php /* Before using this hook please create integer field "priority" and place it on desired template. */ $this->addHookAfter('Pages::saveReady', function(HookEvent $event){ $page = $event->arguments[0]; // if not desired template do nothing // note: set your own template if($page->template != 'blog-post')return; // priority level limit $limit = array( 1 => 3, // priority level 1, allowed max. 3 pages 2 => 2, // priority level 2, allowed max. 2 pages 3 => 1 // priority level 3, allowed max. 1 page ); // processing only if priority has changed and not changed to zero if($page->isChanged('priority') && $page->priority > 0) { $level = 3; // max priority level while($level > 0) { // test with different "sort" selector (eg. -modified, -created, or by custom date field) $group = $this->pages->find("template=blog-post, priority=$level, sort=-modified"); if($level == $page->priority) { $count = $group->has($page) ? $group->count : $group->count + 1; } else { $count = $group->has($page) ? $group->count - 1 : $group->count; } if($count >= $limit[$level]) { for($i = 1; $i <= ($count - $limit[$level]); $i++) { $group->eq($group->count - $i)->setAndSave('priority', $level - 1); } } $level = $level - 1; } } }); Regards.
  1. Load more activity
  • From Twitter

    • New post: The RC1 version for our next master release is here. We also look at a a new PageAction module added to L… twitter.com/i/web/status/1…
      December 8 12:27 am
    • New post: ProcessWire 3.0.120 on the dev branch, plus discussion of our work towards the next master version. In ad… twitter.com/i/web/status/1…
      November 30 9:15 pm
    • New post: This week we take a look at what's new in ProcessWire 3.0.119 and then we finish up by taking a look at a… twitter.com/i/web/status/1…
      November 16 9:04 pm