Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/27/2016 in all areas

  1. Thank you, Adrian! People like you make PW community so pleasant to be involved in. Not only the code you share has helped me and many others numerous times, but your attitude: friendliness, passion and commitment. This module of yours is a true example of the best international open source spirit. Thank you for your marvelous work. And... please keep it going) The post is awesome too . It is kind of hard to go through the dozen pages of the original module forum thread and not get lost at the first time. Sum up for it is a great idea and there is no better place for it than the official PW blog. Congrats!
    5 points
  2. Thank you Ivan - very kind words indeed There is definitely something about this community - Ryan has managed to foster an environment where people really want to share and help others - almost addictively. I think it's a very rare thing we have here. I completely agree - I was actually wondering myself how I was going to manage to make something useful out of all the info in the support thread. I guess it should probably end up in the ReadMe at some point, but then I don't really like having unnecessary screenshot images in the Github repo, so the blog request by Ryan came at a very good time in the evolution of this module. Thanks again.
    3 points
  3. Whew! I got help from Caddy developer abiosoft and now I have a working ProcessWire config! It is included below. Note certain things: - the "php" in the fastcgi line defines a preset, so we don't need to use any "ext" stuff. - the new style rewrite which does not use {uri}: to {path} {path}/ /index.php?it={path}&{query} Abiosoft is also looking into a webtrees instance I have. So far the routing is solved by a workaround of adding a /slash to a certain line the webtrees index.php. Once the issue is solved properly, I can publish the Caddy config on the webtrees forum I urge everyone using Caddy with PW to donate bitcoins to abiosoft! https://mysite.com, https://www.mysite.com { root /wherever/your/files/are fastcgi / unix:/var/run/php-fpm/php-fpm.sock php internal /forbidden rewrite { r /\. to /forbidden } rewrite { r /(COPYRIGHT|LICENSE|README|htaccess)\.txt to /forbidden } rewrite { r ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions) to /forbidden } rewrite { r ^/site(-[^/]+)?/install to /forbidden } rewrite { r ^/(site(-[^/]+)?|wire)/(config(-dev)?|index\.config)\.php to /forbidden } rewrite { r ^/((site(-[^/]+)?|wire)/modules|wire/core)/.*\.(inc|module|php|tpl) to /forbidden } rewrite { r ^/(site(-[^/]+)?|wire)/templates(-admin)?/.*\.(inc|html?|php|tpl) to /forbidden } # GLOBAL rewrite { to {path} {path}/ /index.php?it={path}&{query} } log /var/log/www/access.log { rotate { size 50 age 7 keep 5 } } errors { log /var/log/www/error.log { size 50 age 7 keep 5 } } }
    2 points
  4. Hi everyone, New version just committed. It comes packaged with both stable (2.3.10 - what it was using before) and master (2.4 dev) versions of Tracy. If you have PHP 5.4.4+ it will use the master/dev version which among other improvements, adds support for monitoring of, and allowing dumping from, AJAX calls. One quick way to see the AJAX monitoring in effect is to check "Backend" under the "Show Debug Bar" config option. Then hover over the PW menu in the admin to one of the AJAX-driven submenus - notice the new row in the debug bar showing the time etc for the AJAX request. You'll also see this popup when clicking on the Children tab when editing a page, and several other places throughout the PW admin. Of course this will also work for any AJAX requests on the front-end of you site. Here's a screenshot showing both rows (normal and ajax) with the Dumps panels for both. I have two bd() calls - one "classic" and one via "ajax". Please let me know if you notice any issues with this new version.
    2 points
  5. Just wanted to let you all know that I added a new section to the blog post. Hard to believe I had missed anything given how long it already was, but this new section deals with Access Permissions / Restrictions and how they are controlled/related to the Detect, Development, & Production Modes. Here's the shortcut link to this new section: https://processwire.com/blog/posts/introducing-tracy-debugger/#access-permissions-restrictions Hopefully you'll find it useful in understanding who has access to what with which settings. Please let me know if there is still something that isn't clear or even if you have suggestions on how the settings/logic might be tweaked.
    2 points
  6. A couple of posts: https://processwire.com/talk/topic/5762-how-do-we-use-pagestack/ https://processwire.com/talk/topic/3660-what-page-was-the-caller-of-render/
    1 point
  7. I have a hook after saveReady that change some SEO fields on publishing the page.... my editors should publish a page when the work is nearly finished so content and other things are on the line and i can with some functions create my semiautomatic SEO fields content. Most editors don't care about SEO fields and SEO tab i have to create the content...in the example i use the summary (or in german "kurztext") that exists in article pages, if that summary is not there (like on normal pages) i cut some text from the first textfields of my pagetable contentblock templates...so you can skip this part if you just set the summary to seo_description! So Users could overwright the seo fields but could not leave them empty... Extracted example for seo title and description ignore some own functions for formatting proposal...: /** * Hook for changing seo_* fields if empty on Page Publish */ $pages->addHookAfter('saveReady', null, 'changeSeoFields'); function changeSeoFields(HookEvent $event) { $page = $event->arguments[0]; //for this template only if($page->template == 'artikel'|| $page->template == 'seite') { // page is about to be published if($page->isChanged('status') && !$page->is(Page::statusUnpublished)) { // check if seo_title fields are exist and if they are empty if (!$page->seo_title) { //get the default value that would used as fallback if ($page->headline) { //Headline field is used for seo_title $default_title = ripTags($page->headline); } else { //Headline field empty - page title is used $default_title = ripTags($page->title); } //set seo_title on publishing $page->set ('seo_title', $default_title); } // check if seo_description fields are exist and if they are empty if (!$page->seo_description) { //get the default value that would used as fallback if ($page->kurztext) { $default_desc = ripTags($page->kurztext); } else { //is there a main content block as pagetable field pt_inhalt? if(count($page->pt_inhalt)>0) { //get the first text field in the pagetable and use it for the seo description $first_item = $page->pt_inhalt->get("template=part_text|part_text_image_left|part_text_image_right|part_text_spalten"); $first_content = ripTags($first_item->text); $default_desc = wordLimiter($first_content, 160); } } //set seo_description on publishing $page->set ('seo_description', $default_desc); } } } } Best Regards mr-fan
    1 point
  8. The only things that won't work in 2.7 are the NonPW Template Variables panel, and the Runtime Debug Statements functionality. I feel like there should be a way to make the former work in 2.7 but I haven't figured it out yet and with 3.x stable not that far away I don't have too much motivation to. The latter won't though, although as mentioned it's a bit of an obscure feature anyway
    1 point
  9. The second change could easily be made by a hook to FieldtypeComments::getConfigInputfields, where $event->return is the form you can edit. $f->insertAfter() will make this really easy to add in.
    1 point
  10. @Christophe and @jploch - I have committed a very quick fix that allows this module to work even if you don't have ffmpeg installed. Obviously the ability to grab poster images for the video won't work. Also it won't be able to determine the length of the video. Both of these require ffmpeg. I will revisit this again when I am back from vacation and add the ability to manually upload a poster image, but for now at least this module will work and you can now have the benefits of automatically playing videos with a simple: echo $page->video_field->play; Hope that helps as an interim improvement.
    1 point
  11. @pete: I'll have holidays at university in around a month and gonna tackle all open issues with the module from GitHub. So thanks for finding it - could you add it at GitHub as well so I won't forget it?
    1 point
  12. Have a look if your mysql configuration has strict_trans_tables or strict_all_tables set. This prevents zero dates (since 5.7.4) from working. See http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-changes for details.
    1 point
  13. Little site note on the unique methode after the Wirearray of files: $config->jsFiles->unique() Appending unique isn't needed anymore, as the ->add('script-here') insures it's uniqueness. This works for 2.2, 2.3 and dev.
    1 point
  14. I decided to use the way Soma suggested Created css, js and views folder inside templates and include a layout.php file for basic layout/ design at the end of each site template (=controller) file. Templates are used as controller and use views via templateFile class. $config->jsFiles = new FilenameArray(); $config->cssFiles = new FilenameArray();Simple add scripts at the top like this. $jsFiles = array('js/first.js', 'js/second.js'); $cssFiles = array('css/normalize.min.css', 'css/pocketgrid.min.css', 'css/layout.css');Because of the js/ css order (site template add scripts/ styles before layout template) I have to take care about the add/ prepend order of the basic/ first styles and scripts. Solved it with array_reverse. $tplDir = $config->urls->templates; foreach (array_reverse($jsFiles) as $jsFile) { $config->jsFiles->prepend($tplDir . $jsFile); } foreach (array_reverse($cssFiles) as $cssFile) { $config->cssFiles->prepend($tplDir . $cssFile); } Last step is output at the layout.tpl.php view $view->set ('js', $config->jsFiles->unique()); $view->set ('css', $config->cssFiles->unique()); <?php foreach($js as $file): ?> <script src="<?php echo $file; ?>"></script> <?php endforeach; foreach($css as $file): ?> <link rel="stylesheet" href="<?php echo $file; ?>" /> <?php endforeach; ?> To build my layout I use normalize.css V1 and pocketgrid (thanks Soma ).
    1 point
  15. In some projects I use a mix of the $config->scripts and $config->styles FilenameArray to add scripts in templates. And one similar to the one Ryan, where I can create js and css files with the name of the template and they'll get loaded if existing. In a recent project I use a custom $config->siteScripts = new FilenameArray(); $config->siteStyles = new FilenameArray(); I set in a autoload module. Then I add the script in a template: $config->siteScripts->add($config->urls->templates . "js/yx.js"); This also allows for modules I create, for example widgets (that are not autoload), that need scripts/styles to add them with simply adding the method above in the init(). So as soon as I load the module in the front-end they'll get added to the array. To output, I use the same method as found in default.php from the admin template. <?php foreach($config->siteScripts->unique() as $file) echo "\n\t<script src='$file'></script>"; ?> You could also just use the $config->scripts used in the backend, but if you use form (InputfieldForm) API in the front-end, loading inputfields modules will also load scripts and styles from those in the filename array. This may not desired, that's why I use a custom filename array. For anything basic and global, I add scripts and styles hardcoded in the main template.
    1 point
×
×
  • Create New...