Jump to content

jploch

Members
  • Posts

    347
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by jploch

  1. Thx for your quick reply! I made a custom.php file in MarkupFontIconPicker/Icons/ Now I have this in the admin.php in templates folder: wire()->addHook('InputfieldFontIconPicker::beforeRender', function($event) { if(!$event->return) return; // Get Input Name (For specified input hook, if you want apply all InputfieldFontIconPicker remove inputName check) $inputName = ""; if(isset($event->object->attributes['name'])) $inputName = $event->object->attributes['name']; // Get Input Name (For specified input hook, if you want apply all InputfieldFontIconPicker remove inputName check) if($inputName == 'icon_picker') { /** * Load your custom icons function file * Your array need to be same format with Icons/FontAwesome.php or Icons/Ionicons.php * Also you can pass directly an array */ wireIncludeFile('http://projekte.janploch.de/fabricius/site/modules/MarkupFontIconPicker/Icons/custom.php'); // Set icons as $icons variable $icons = MyCustomIconsArray(); // Set your options $return = array( 'attributes' => array( 'category' => '', 'theme' => 'fip-grey', 'empty-icon' => 1, 'empty-icon-value' => '', 'icons-per-page' => 20, 'has-search' => 1 ), 'icons' => $icons ); // Return the event $event->return = $return; } $event->return; }); In the Backend only the FontAwesome and Ionicicons library is showing. Custom File looks like this: <?php function InputfieldFontIconPickerIcons() { $icons = array( 'title' => 'Custom', 'version' => '2.0.1', 'css' => 'http://projekte.janploch.de/fabricius/site/templates/fonts/icomoon/style.css', 'categorised' => false, 'prefix' => 'icon-icon-', 'icons' => array( 'doctor', 'kita' ) ); return $icons; }
  2. Hi! Thx for this cool module! I want to use this with a costum Icon-Set and need some help. I did put an URL in the custom css field, but my Icons dont show up in the backend. Is there anything else I have to do to get this to work?
  3. I reinstalled the module, and now its working. When I setup the repeater to allways open the items the map and magnifying glass icon seems to work. Thanks for your help!
  4. is there a trick, when using this with a repeater for multible markers in PW 3? Here is my code, but thats not working: <?php $lage = wire('pages')->get("/lage/"); $items = $lage->map_repeater; echo $map->render($items, 'map'); ?> Also in the backend, the Address field is not clickable, when I use the Map Field in a Repeater Edit: It seems that the files for the module are not loading. I get an error in the console that the files are not loading.
  5. thx! I just figured this out, when reading the documentation, I must have missed it.
  6. Hey guys! I have a problem with this. When I put the <?php echo $map->getLeafletMapHeaderLines(); ?> in the header of my template a get a Error: Call to a member function getLeafletMapHeaderLines() on a non-object (line 34 of /www/htdocs/w00dd152/projekte/fabricius/site/templates/_header.php) I have checkt the permissons on the module files, everything is on 777. I also pressed the reload button (as suggested) on the module page in PW but still no luck. Iam running PW 3.0.30 devns
  7. I don't know the exact sizes of the images thats why I just set the width. But thanks for your explanation. I will test it on different devices and see if its working
  8. Hi! I have another problem with this. When I test my images on different resolutions, there seems to be a problem with loading the correct resources. The images that are created in the assets folder are fine, but most of the time just the biggest image gets loaded. I testet this with resizing the browser, reloading the page and saving the image and looking at the size. Here are my module settings in PW: "albumimage": [ [360, null], [720, null], [1300, null], [1600, null] ] This is the generated markup: <img src="/website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.360x0.jpg" data-srcset="/website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.360x0.jpg 360w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.720x0.jpg 720w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.1300x0.jpg 990w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.1600x0.jpg 1300w" data-sizes="(max-width: 1600px) calc(100vw - 20px), 1600px" class="inline-block lazyloaded" alt="" sizes="(max-width: 1600px) calc(100vw - 20px), 1600px" srcset="/website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.360x0.jpg 360w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.720x0.jpg 720w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.1300x0.jpg 990w, /website_susannerudolf/site/assets/files/1184/logo_wirtschaftsclub-stuttgart.1600x0.jpg 1300w"> Thanks for your help!
  9. Hey! I just finished working on a website for a client. To restrict the use of PW for the client (so he can't brake the website), I created a new User and asigned some permissions. The problem is, that the link to the page tree is missing, when I login with the new user (see screenshot). Only the "Add New" shortcut works. When Iam logged in as admin, everything works fine. I never had this problem before. Iam using PW 3.0.25 Any Ideas? THX!
  10. I forgot the "echo $out;" at the end. Now I feel a little stupid. My only excuse is that its monday morning without coffee Everything is working now! Thank you for this module and your patience with my problems!!
  11. Its still not working. No images or html gets rendered from this function (rest of the page looks fine). There are no error messages (debug mode turned on), so I guess the syntax is fine. I use the image extra module with this. Could this be a problem?Anyway thanks for your help! Here is the complete code: // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ // if there's no thumbnail no need to do anything if(!$album->thumbnail) continue; // save srcset tag to a variable $srcset = $album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80)); $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img $srcset alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } }
  12. it holds multiple images. I tryed using first(). Now I get this: Error: Exception: Method Pageimage::first does not exist or is not callable in this context (in /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php line 409) #0 [internal function]: ProcessWire\Wire->___callUnknown('first', Array) #1 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(347): call_user_func_array(Array, Array) #2 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pageimage), 'callUnknown', Array) #4 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(371): ProcessWire\Wire->__call('callUnknown', Array) #5 /homepages/11/d86659974/htdocs/website_susannerudolf/wire/core/Wire.php(371): ProcessWire\Pageimage->callUnknown('first', Array) #6 /homepages/11/d86659974/htdocs/website_susannerudolf/site/temp This error message was shown because: you are logged in as a Superuser. Error has been logged. sorry my bad, it was a long day, its just an image field with a single image. And it works when I use it without the module syntax like: // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img src='{$album->thumbnail->url}' alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } echo $out; } but still no luck using the module syntax
  13. Iam using PW 3.0.25. Maybe thats the problem?
  14. I forgot to copy the out, but its there. here is the complete code: / album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))} alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } echo $out; } I get the error: Error: Call to a member function srcset() on null (line 14 of /homepages/11/d86659974/htdocs/website_susannerudolf/site/templates/_func.php) Line 14 is this: $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))}
  15. Hi! This is probably a noob question (Iam a designer and frontend guy, just learned some basic php) : I have several functions in a _function.php that I include in my templates. How can I use this within a function in that file? I guess I have to redefine the variables, because they are not available there, but Iam not sure how to do this. Here is an example (not working): // album list function ---------------------- function albumList(){ // Get the list of albums $albums = wire("pages")->find("parent=/work/, template=project, limit=100, sort=sort"); $out =" "; //Loop through the pages foreach($albums as $album){ $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img {$album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80))} alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } So how is the syntax for this?: <img <?php echo $page->featured_image->srcset('featured-image', 'lazyload my-class inline-block', array('quality' => 80)); ?>> Iam using PW 3.0.25 Thanks! this module looks very promising!
  16. I don't know if this is a known issue, but the orientation dropdown isn't working with the new image field from PW 3.0 and 2.8. I tried the develop branch, but had no luck. Anyway thx for this great module! Edit: I just found out, that the dropdown is working in grid view, but not in list view Edit2: none of the extra fields is working in list view
  17. @adrian thanks for your quick reply! now i get a error, when I install the module (new version from github):
  18. @adrian sounds great! i think that would help a lot of people that can't use ffmpeg or have no experience on how to set it up. enjoy your vacation!
  19. iam looking for a way to use this without ffmpeg (not supported by my hosting environment). I won't mind to upload a thumbnail manually. are there any plans to support this? youtube or vimeo are not an option for me. thanks!
  20. That worked!! Thank you so much! I Really learned something. Now I can finally use my functions in a separate file and feel more like a developer
  21. THX again! that worked for me. Now I only have to figure out the part with the $sanitizer. Iam not sure how to use this and couldn‘t find an example. I want to apply the sanitizer to the array "$alltags" and save it in another array (eg. $alltagsLinks) here is an example of what I try to do (its not the right syntax) $alltags = explode("|", $page->thumbnail->tags); $alltagsLinks = $alltags->$sanitizer->pageName($value, true)
  22. It still outputs an emtpy list. any ideas why the tags are not showing up? function footerProjekte(){ $alltags = explode("|", $page->thumbnail->tags); echo "<ul>"; foreach($alltags as $tag) { echo "<li><a href='{$tag}'>{$tag}</a></li>"; } echo "</ul>"; } thx!
  23. @LostKobrakai thanks for your reply! Iam still quite new to php and the api. The explode function is exactly, what I was looking for. I tryed the code above, but its just outputting the "ul" and a "li" with a empty link in it. If I just print $page->thumbnail->tags it shows the tags, so they definitely exist. Another problem Iam facing is that some tags are like "corporate design" with a space in it, for the link I will need an array wich converts that to "corporate-design".
  24. Hey guys, i want to put out a list with tags from an image field (thumbnail) of the page beeing viewed. The tags should link to pages, with the same name as the tags. The Tags are seperates by "|" (instead of a space). Here is my code (wich is not working): function footerProjekte(){ $alltags = $page->thumbnail->tags; echo "<ul>"; foreach($alltags as $tag) { echo "<li><a href='{$tag}'>{$tag}</a></li>"; } echo "</ul>"; } any ideas? Thx!
  25. Hey guys! I just launched my new online portfolio. http://janploch.de/ This is my second site with PW and I really enjoyed working on it. Its in german, but I want to launch an english version soon (just have to figure it out). I would probably never have finished it without the help of this awesome community. Thanks for your support! Feedback appreciated. (The size of the Images are a bit heavy for mobile, I would like to improve that with "srcset" or the picture element, but Iam not sure how to do that with PW without multiple image uploads.)
×
×
  • Create New...