Jump to content

tmode1960

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

804 profile views

tmode1960's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. moved to https://processwire.com/talk/topic/8088-textformattersrcset-responsive-images-with-hidpi-lazyload-and-much-more/
  2. Hello, I hope, I'm in the right section here. I have a problem with the TextformatterSrcset. I've downloaded the module and installed it under site/modules/TextformatterSrcset. On the configration page I've set Resolution: 320,720,960 for test purposes and use smallest size as LQP. In my body field under details I added the TextformatterSrcset. Then I loaded up an image (called test.jpg) to my image field (array). In site/assets/files/1 I can see now the file test.jpg. When I insert the image in the body, in site/assets/files/1 are two more file: test.0x100.jpg and test.1020x0-is.jpg When I now want to view the site, three new images appears in the site/assets/files/1 folder: test.320x0.jpg test.720x0.jpg test.960x0.jpg but in the browser I see the following errors: Notice: Undefined offset: 0 in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 100 Notice: Undefined offset: 1 in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 122 Notice: Trying to get property of non-object in /var/www/clients/client5/web11/web/wire/core/Page.php on line 685 Warning: Invalid argument supplied for foreach() in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 131 Notice: Undefined offset: -1 in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 143 Notice: Undefined variable: image in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 148 Notice: Trying to get property of non-object in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 148 Notice: Undefined variable: image in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 190 Fatal error: Call to a member function width() on null in /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module on line 190 Error: Call to a member function width() on null (line 190 of /var/www/clients/client5/web11/web/site/modules/TextformatterSrcset/TextformatterSrcset.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Someone have a tip for me what my mistake is? My development equipment: Server Distributor ID: Debian Description: Debian GNU/Linux 7.10 (wheezy) Release: 7.10 Codename: wheezy PHP 5.4.45-0+deb7u2 Zend Engine v2.4.0 with XCache v2.0.0 Software ProcessWire 2.7.2 TextformatterSrcset 1.0.0 Sorry for my english, it's not my native language. Greetings Tom [NOT SOLVED] Problem returns on new server too. Don't know what to do to use this module.
  3. Thanks for the awesome fast reaction.
  4. I have had the same Problem with the unformatted date. Using PW 2.7.2 and Blog 2.3.8 running on a SMP Debian 3.2.65-1+deb7u2 x86_64 Server with PHP 5.4.38. Then I changed $date = $blog->formatDate($comment->created, 2); with $date = $blog->formatDate($comment->created, 2); $ux2date = date('d.m.Y h:i', $date); $date = $ux2date; and this solved the problem for me. Greetings Tom
  5. Hallo all... I'm trying to make a off-canvas menu. It works well but with a litte output error. This is the output it should looks like <!-- how it should be --> <ul> <li><a href="#"><i class="fa fa-picture-o"></i> Portfolio</a></li> <li><a href="#"><i class="fa fa-user"></i> About</a></li> <li><a href="#"><i class="fa fa-envelope-o"></i> Contact</a></li> <li> <!-- Second tier dropdown --> <label for="dropdown-1" class="dropdown-1"><a><i class="fa fa-coffee"></i> Blog</a></label> <input type="checkbox" name="menu" id="dropdown-1"> <ul class="dropdown-1"> <!-- Dropdown links here --> <li><a href="#"><i class="fa fa-code"></i> Tutorials</a></li> <li><a href="#"><i class="fa fa-eye"></i> Inspiration</a></li> </ul> </li> </ul> But it looks like <!-- how it looks like --> <ul> <li><a href='/de/portfolio/'><i class='fa fa-file-text-o'></i> Portfolio</a></li> <li><a href='/de/about/'><i class='fa fa-file-text-o'></i> About</a></li> <li><a href='/de/contact/'><i class='fa fa-file-text-o'></i> Contact</a></li> <li> <!-- this should not be there --> <a href='/de/blog/'><i class='fa fa-file-text-o'></i> Blog</a> <!-- this should not be there --> <li> <label for='dropdown-1' class='dropdown-1'><a><i class='fa fa-file-o'></i> Blog <i class='has-item fa fa-arrow-down'></i></a></label> <input type='checkbox' name='menu' id='dropdown-1'> <ul class='dropdown-1'> <li><a href='/de/blog/tutorials/'><i class='fa fa-file-text-o'></i> Tutorials</a> </li> <li><a href='/de/blog/inspiration/'><i class='fa fa-file-text-o'></i> Inspiration</a></li> </ul> </li> </ul> And here is the render function function renderOffCanvas(PageArray $items, array $options = array(), $level = 0) { $defaults = array( 'tree' => 1, // number of levels it should recurse into the tree 'repeat' => false, // whether to repeat items with children as first item in their children nav ); $options = array_merge($defaults, $options); $page = wire('page'); $out = ''; foreach($items as $item) { $numChildren = $item->numChildren(true); if($level+1 > $options['tree'] || $item->id == 1) $numChildren = 0; $class = ''; if($numChildren) $class .= ""; if($page->id == $item->id) $class .= ""; if(($item->id > 1 && $page->parents->has($item)) || $page->id == $item->id) $class .= ""; if($class) $class = " class='" . trim($class) . "'"; $out .= "<li$class><a href='{$item->url}'><i class='fa fa-file-text-o'></i> {$item->title}</a>\n"; if($numChildren) { $out .= "<li>\n<label for='dropdown-1' class='dropdown-1'><a><i class='fa fa-file-o'></i> {$item->title} <i class='has-item fa fa-arrow-down'></i></a></label>\n"; $out .= "<input type='checkbox' name='menu' id='dropdown-1'>"; $out .= "<ul class='dropdown-1'>\n"; if($options['repeat']) $out .= "<li><a href='$item->url'>$item->title</a></li>\n"; $out .= renderOffCanvas($item->children, $options, $level+1); $out .= "</ul>"; } $out .= "</li>\n"; } return $out; } I'm sure the error is in the render function, but I don't know where. Maybome someone can help me. And sorry that I can't show it online have only a local development environment. Greetings Tom
×
×
  • Create New...