Jump to content

Alf S.

  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alf S.

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @bernhard No, but I read the PDF (http://www.mpdfonline.com/repos/mpdfmanual.pdf) and as far as I can see it has the same content … how ever … SVGs "should" work. So the question is if there is a problem with the module or with my installation or who knows? … if nothing works, I will disable SVG files and I will use PNGs instead …
  2. Hello there, I tried to use SVG files in image tags and some of the vector paths are "destroyed" and everything in the SVG is black. Then in tried inlining the SVG: if( $img->ext == "svg") echo "<div class'card__img'>".file_get_contents($img->filename)."</div>"; else echo "<img class='card__img' src='{$img->url}'>"; This outputs a small icon with a red "X" … meaning; "file not found" … I guess. Before one of the icons there was this line in the PDF: <?xml version="1.0" encoding="utf-8"?> So this means the module found the file but did not render the content. (… and YES, I saw there is a module "ImageRasterizer", but unfortunately it requires Imagemagick and the pecl imagick extension.)
  3. There are two different ways to get the label of any input Field: echo "This is the field label: {$page->fields->get("simple_slider")->label}"; echo "This is the field label: {$page->fields->get("simple_slider")->getLabel()}"; Let's pretend I added to my image field an extra field "location" with the label "This was in:". So if I want the value of the "location" field I do it like this: echo "This is was in: {$page->simple_slider->location}"; // Outputs "Barcelona" How can I get the LABEL of the location field? Something like: // not working code: echo "{$page->fields->get("simple_slider")->location->getLabel()}: {$page->simple_slider->location}"; // Should output "This was in: Barcelona"
  4. Great. This is significantly shorter and it works ... at least on the xampp local installation... $page->icon->filename // gives me this: D:/xampp/htdocs/processwire/site/assets/files/1099/battery.svg Probably I can assume that this works on a "real" server too. I'll give it a try next days. Thank you. PW is great.
  5. Hello there. I was wondering if there is a more elegant way inlining an SVG that was uploaded in the backend by an image field? // /processwire/site/assets/files/1101/monitor.svg <- this is what I get // ../assets/files/1101/monitor.svg <- this is what I need $iconURL = $page->icon->url; $findThis = '/assets/'; $iconURL_arr = explode($findThis, $iconURL); $iconURL = "..".$findThis.$iconURL_arr[1]; echo "<span class='icon'>".file_get_contents($iconURL)."</span> ... and before somebody is asking: - yes, I want it inline. - and no, I do not want to use an icon font.
  • Create New...