Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/03/2018 in all areas

  1. I did a develop and made dis, a procedural galaxy that, well... gets procedurally generated. You can use your mouse to zoom in/out and look around. You can click on stars to get their specific information. It's inspired by the galaxy maps found in games like Elite Dangerous and Eve Online. http://fransvanberendonk.com/procedural-galaxy/ Basicly I've made Templates and Fields for Spectral Classes and Subclasses, and looked up online what a realistic distribution scheme would be for these. This data is grouped under a page that renders then as JSON for the Javascript application to work with. I wrote that app in AngularJS, so I could add more controllers to it later. It also uses BabylonJS to calculate the number and position of stars and display them on screen, and assigns each a Spectral Class and Subclass after some shuffling of the dataset. Using a secondary controller only used in a ProcessModule for the CMS, I can broadcast events that redo the procedure using different variables (see screenshot below). No particular purpose, just thought I'd share a cool side project that rolled out of my exploration of these JS frameworks in conjunction with PW.
    7 points
  2. Adds a class="external" and a rel="nofollow" to every external link by default. Optionally adds a rel="noopener", a rel="noreferrer" and a target="_blank". Note: This module is based on TextformatterMarkExternalLinks and some improvements of @teppo that were never implemented due to module's author inactivity. Download TextformatterOptimizeExternalLinks Requirements ProcessWire 3.x Changelog 1.0.0 (3 April 2018) Initial release
    6 points
  3. Extend the list with those characters here: /module/edit?name=InputfieldPageName
    3 points
  4. You could use zipped files (only helps if files are not compressed already). Or modify PHP settings: https://stackoverflow.com/a/2184541 https://stackoverflow.com/a/3829578
    2 points
  5. Hi @Sabrina, I've removed the link in your post. Given that you are a first time poster and there is no indication that you are using ProcessWire, your link could have been subtle advertising. This is not allowed. If I am wrong, please clarify. We'll be happy to help if your site is made using ProcessWire.
    2 points
  6. For any field that references a page, the syntax to access and search content in the referenced page is the same. You use dot syntax in the form page_reference_field_name.field_name. This applies equally to Page Reference, PageTable and Repeater / Repeater Matrix field types. So if you use a Page Reference field called "social_networks" that contains pages for Facebook, Twitter and LinkedIn, and those pages contain a "body" field that you want to search, your selector would be: social_networks.body%=foo This will match the page that contains the social_network field rather than the referenced pages. So exactly what you are wanting to do.
    2 points
  7. I might not be getting the full picture here but... It should be found if you use 'include=hidden' in your selector. Assuming the hidden pages will always refer to their parents... $search = $pages->find('body%=something, include=hidden'); $out = '<ol>'; foreach ($search as $s) { // if page hidden, grab url of parent if($s->isHidden()) $url = $s->parent->url; // if at the top of the tree, just return the found page URL elseif($s->rootParent == $s) $url = $s->url; // normal find else $url = $s->url; $out .= '<li>' . $url . ' (original path: '. $s->url.')</li>';// just for testing } $out .= '</ol>'; echo $out; You might want to change the logic a bit
    2 points
  8. Ok, dumping with the __debugInfo() magic method is now the default. You can disable this in the config settings if you don't like it and you can override for a specific dump with something like this: d($page, array('debugInfo' => false)); Hope you guys find this useful!
    2 points
  9. Is your page unpublished? InputfieldPassword is set to required on unpublished pages regardless of what you might have chosen in the field settings - see here. Probably only @ryan could tell you why this is so. You can work around the issue with a hook in /site/ready.php: // You may need to modify "pass" to whatever your password field is named $wire->addHookBefore('Field(name=pass)::getInputfield', function(HookEvent $event) { $page = $event->arguments(0); $field = $event->object; // Do some test on $page and/or $field to identify the cases where the password field should not be required // Then... $field->required = false; });
    2 points
  10. Docs & Download: rockettpw/seo/markup-sitemap Modules Directory: MarkupSitemap Composer: rockett/sitemap ⚠️ NEW MAINTAINER NEEDED: Sitemap is in need of developer to take over the project. There are a few minor issues with it, but for the most part, most scenarios, it works, and it works well. However, I'm unable to commit to further development, and would appreciate it if someone could take it over. If you're interested, please send me a private message and we can take it from there. MarkupSitemap is essentially an upgrade to MarkupSitemapXML by Pete. It adds multi-language support using the built-in LanguageSupportPageNames. Where multi-language pages are available, they are added to the sitemap by means of an alternate link in that page's <url>. Support for listing images in the sitemap on a page-by-page basis and using a sitemap stylesheet are also added. Example when using the built-in multi-language profile: <url> <loc>http://domain.local/about/</loc> <lastmod>2017-08-27T16:16:32+02:00</lastmod> <xhtml:link rel="alternate" hreflang="en" href="http://domain.local/en/about/"/> <xhtml:link rel="alternate" hreflang="de" href="http://domain.local/de/uber/"/> <xhtml:link rel="alternate" hreflang="fi" href="http://domain.local/fi/tietoja/"/> </url> It also uses a locally maintained fork of a sitemap package by Matthew Davies that assists in automating the process. The doesn't use the same sitemap_ignore field available in MarkupSitemapXML. Rather, it renders sitemap options fields in a Page's Settings tab. One of the fields is for excluding a Page from the sitemap, and another is for excluding its children. You can assign which templates get these config fields in the module's configuration (much like you would with MarkupSEO). Note that the two exclusion options are mutually exclusive at this point as there may be cases where you don't want to show a parent page, but only its children. Whilst unorthodox, I'm leaving the flexibility there. (The home page cannot be excluded from the sitemap, so the applicable exclusion fields won't be available there.) As of December 2017, you can also exclude templates from sitemap access altogether, whilst retaining their settings if previously configured. Sitemap also allows you to include images for each page at the template level, and you can disable image output at the page level. The module allows you to set the priority on a per-page basis (it's optional and will not be included if not set). Lastly, a stylesheet option has also been added. You can use the default one (enabled by default), or set your own. Note that if the module is uninstalled, any saved data on a per-page basis is removed. The same thing happens for a specific page when it is deleted after having been trashed.
    1 point
  11. If you've ever needed to insert links to a large number of files within CKEditor you may have found that the standard PW link modal is a somewhat slow way to do it. This module provides a quicker way to insert links to files on the page being edited. You can insert a link to an individual file, or insert an unordered list of links to all files on the page with a single click. CKEditor Link Files Adds a menu to CKEditor to allow the quick insertion of links to files on the page being edited. Features Hover a menu item to see the "Description" of the corresponding file (if present). Click a menu item to insert a link to the corresponding file at the current cursor position. The filename is used as the link text. If you Alt-click a menu item the file description is used as the link text (with fallback to filename if no description entered). If text is currently selected in the editor then the selected text is used as the link text. Click "* Insert links to all files *" to insert an unordered list of links to all files on the page. Also works with the Alt-click option. Menu is built via AJAX so newly uploaded files are included in the menu without the page needing to be saved. However, descriptions are not available for newly uploaded files until the page is saved. There is an option in the module config to include files from Repeater fields in the edited page. Nested Repeater fields (files inside a Repeater inside another Repeater) are not supported. Installation Install the CKEditor Link Files module. For any CKEditor field where you want the "Insert link to file" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "LinkFilesMenu" to the "CKEditor Toolbar" settings field. http://modules.processwire.com/modules/cke-link-files/ https://github.com/Toutouwai/CkeLinkFiles
    1 point
  12. Doesn't it work when he prefix his file with: <?php namespace ProcessWire;
    1 point
  13. setLanguageValue is a method of the $page api variable: https://processwire.com/api/ref/page/ $p->setLanguageValue($language, $field, $value); You cannot call it from the $p->summary property
    1 point
  14. I am happy to present you the first processwire powered page i made for a client. Some more in the pipeline, but on hold because of missing content on the client side Big thanks to this helpful and great community!! https://feuerwehr-gimbsheim.de/ my own site webgestaltung.net is online for a while already, but not holding much content yet.
    1 point
  15. Finally back in the saddle: @horst Thanks for these links! Even though it's in the new skyscraper code, I hadn't even noticed the region method initially, so these are valuable links for anyone diving into pw/ajax in the future. @neosin Thanks! Yeah, you're exactly right. Horst also pointed this out earlier in the thread...but it was in German
    1 point
  16. https://processwire.com/talk/topic/7752-huge-file-uploading-problem/ https://processwire.com/talk/topic/2190-max-file-size-for-uploading-a-file/ https://processwire.com/talk/topic/17930-solved-urgent-problem-uploading-large-files-new-insights/ https://processwire.com/talk/topic/10818-fileupload-stops-at-100/
    1 point
  17. Hi, ah, ok, now I'm getting it. About the download link: I created a field (type: files). The frontend shows me this: <a href="&lt;br /&gt;&#10;&lt;b&gt;Notice&lt;/b&gt;: Trying to get property of non-object in &lt;b&gt;/var/www/web27428586/html/processwire/site/assets/cache/FileCompiler/site/templates/publications.php&lt;/b&gt; on line &lt;b&gt;18&lt;/b&gt;&lt;br /&gt;&#10;">Download</a> I found this article: https://jensmartsch.de/blog/simple-file-downloads-with-processwire/ I'll try it tomorrow. Thanks, I'll do this
    1 point
  18. Oh i see what you mean, an external plugin that adds to the column without altering the data , Hmm I will look at the documentation more. I think i get now
    1 point
  19. Yep, that's with the overhead is right, but only on the first view. If you have many fields and reference fields on one page (template), your searches may become time costy in the DB. At that point you want to use concatenated fields (also available as core module!). So it depends on the amount of your involved fields (=DB-tables) which way to go. EDIT: The core module is called Cache, it is a fieldtype:
    1 point
  20. Thanks @horst, I have also thought about this to add the values via a page save hook to a field, but I have hoped that there will be a more elegant solution (fe. via a page reference field or something like that). Storing the same data twice is a little bit of overhead.
    1 point
  21. Maybe a bit dirty but very effective: add a hidden (or none manually editable) textarea field to your main page and on save of the main page or one of the children, collect all text there in. Then you need to search in this field instead of the (main)-body field.
    1 point
  22. What is the server setting for uploads? What output is in the JS-console when your upload freezes? Do you have any log entries for images in PW? $config->debug = true?
    1 point
  23. Sure, thanks for the help. I've managed to get the first children by using $parent->find('...., limit=1')->first(), so that it doesn't load all pages. For the last child I plan to use $parent->find('..., start=$numSiblings-1, limit=1')->first() which should not load all pages (haven't had the chance to try yet). I think these will be fine but if you know a simpler approach, please tell.
    1 point
  24. Hi @neophron, Just some thoughts to find the cause of this behaviour. Do you have full control over the PW installation? Does the folder ../templates/assets and all the files within have the same ownership and rights as the containing folder (or any other folder)? I ask because this is not a standard folder and it was created specially at some point. Also, you might want to check your .htaccess file in the site root folder. Is there a rule which prevents the access? Hope this helps for a start.
    1 point
  25. 1 point
  26. You'll know more about this than me, but my understanding is that what is available in a dump from __debugInfo() depends on what the developer of the class makes available in the method. So if that method in a class was quite limited in what it made available (either intentionally or not intentionally) then the Tracy user potentially misses out on a lot of relevant information. To give a silly example, if I do this in a class... public function __debugInfo() { return ['Nothing to see here.']; } ...then dumping an instance of it will be useless. It looks like most of the __debugInfo() work is done in the dedicated WireDebugInfo class. If you think that Ryan has covered everything that anyone could ever need here then I guess shorter/tidier is better. But if you have doubts I'd rather get all the data as per the status quo than be wondering about what might have been overlooked.
    1 point
  27. Would you mind adding some additional information to your question? What is the difference between the two? What would be the pros/cons? I use dumping a lot but I use only very basic features I guess. Most of the information in the first screencap does not seem to be very helpful to me (at least most of the time, or at least not yet). The second looks cleaner to me, but what I do not like is that "template" is a string and not a ProcessWire\Template as shown in the first pic (though that's a tiny detail and i guess dumping $page->template would show the correct classname?). [2min later] To me, the second looks cleaner and more helpful.
    1 point
  28. Hi everyone - looking for some feedback. The Tracy core has just introduced an option to dump objects using the __debugInfo() magic method which PW also supports. It changes this: to: What I am wondering is whether to make using __debugInfo() the default or not. And also wondering how often you guys might want to switch between one vs the other - in other words, will it be ok as a config setting, or do you think it's something that should be easier to change on-the-fly? Thanks for any input.
    1 point
  29. Just had a look for the cause of this and it's: $siblings = $this->editedPage->siblings; which of course loads all siblings. I think you'll need to do: $numSiblings = $this->editedPage->parent->numChildren(); or you could separately check if prev and link page ids exist without the siblings check at all. I know you wanted the links to loop back to first when at the end etc, but I think that needs to be a separate page->get() if at end. Does that make sense?
    1 point
  30. Awesome!!! Thanks!! Thought I've read the whole docs and examples and googled for an hour but found nothing... now it will be a lot more fun working on this tomorrow Maybe I should change the topic title to "everybody who can rtfm better than me, raise your hands" ??
    1 point
  31. A short update this week looking at ProcessWire 3.0.97 and a preview of coming attractions: https://processwire.com/blog/posts/processwire-3.0.97-core-updates/
    1 point
  32. That's ProcessWire! A series of ways to reach your goal. Pick your favourite: Do you like uphill climbing, go there. Do you like to stroll, go here. Another way would be to put a snippet like this into the top of your _main.php: <?php namespace ProcessWire; if('ajax' == $page->template || $config->ajax) { echo region('main'); return; }
    1 point
  33. I'm not quite sure how the original shuffling masonry gallery needs the css classes to be applied, but you probably need nested loops, something like: Note that in your original sample code I see this: data-filter=".cat4" meaning there is prefixing a dot there but not in your code. I also recommend storing the result of the page find selectors in variables, so that you can test easily what you really have. Assigning them to variables also makes it possible to reuse them, which will be needed if you need nested loops. I'm not saying the above code is what you need, because I do not get how the masonry should be assembled in the first place. Can you provide a working demo by any chance?
    1 point
  34. This issue is what primarily stops me from using VS Code for php development (and that means "at all").
    1 point
  35. I have been seeing slower and slower response times on Processwire and Drupal sites on my local Xampp server for a while now. Just spent a couple of hours searching for some hints/fixes. Thought I would share this here as the answer I found that worked for me was reported on Wampp as well and using Joomla and Wordpress so seems to be across the board. I am running Windows 8.1 64bit. That seems to be where the issue stems, and has to do with a bug in that operating system with how they handle IPV6 first then fallback to IPV4. The way this manifests is frequent calls to the database being repeated, increasing server response times. So the fix is as follows. In phpMyAdmin\config.inc.php change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1'; This one I did not actually need as Xampp had that already, but according to the thread I found Mampp did need it. Next uncomment bind-address="127.0.0.1" in mysql\bin\my.ini And finally the real culprit, in Processwire site\config.php change the database configuration from $config->dbHost = 'localhost'; to $config->dbHost = '127.0.0.1'; This same applies for any CMS config file that connects to a MySQL database. (Maybe even any other database too as the issue is with OS) And hey, WOW!! my local dev sites are running way faster now. Hope all that is clear, and useful if anyone else is seeing slow response times locally. Just in case here is my current setup details. Windows Version: Windows 8 Enterprise 64-bit XAMPP Version: 1.8.3 Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 MySQL Community Server (GPL) 5.6.16 libmysql - mysqlnd 5.0.11-dev phpMyAdmin Version information: 4.1.6
    1 point
  36. Ok, got it. $french = $this->languages->get("francais"); $page->of(false); // page->setLanguageValue($french, 'title', $columns['Titre']); $page->setName($columns['Chemin'], $french); $page->set("status$french", 1);
    1 point
  37. Had the same problem, and it turned out to be a classic: On Ubuntu, the default Apache configuration has turned off the "AllowOverride" setting for /var/www, so I had to edit my /etc/apache2/sites-enabled/000-default file like this (the changed part in bold text): From: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> To: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ... and then restart apache with: sudo service apache2 restart (Didn't even need to change the RewriteBase setting in my .htaccess file, although I have a subfolder named "procwire") Hope this helps!
    1 point
  38. Looks like a .htaccess or folder location problem From Ryan When you get 404s for everything but the homepage, that means the .htaccess file is not working. Edit your .htaccess file and paste in some garbage at the top, like "alkjaelfkjaef" and save. Now view your homepage. If you get a 500 error, your .htaccess is working (and you should look at the RewriteBase Nik mentioned). But if your homepage still works, then you know your .htaccess is not working. At this point, you need to tell your web host to turn it on. Or if you run the server, you need to add "AllowOveride All" to your httpd.conf for the account. Try this 1. find the line "# RewriteBase /" 2. delete the "#" 3. Important: put in the whole URL of your processwire-folder without the "http://" From Nik Did you try this in your .htaccess already? RewriteBase /processwire-folder/ And then try http://mywebsite.com/processwire/ That would be the url if you didn't change it during the install.
    1 point
×
×
  • Create New...