Jump to content

Smirftsch

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Smirftsch

  1. Sorry to catch up this older topic again, but there seems to be no changes in sight so far. I also still would find it useful to have webp as input format. The need- or the wish- to use it, is from my experience originated in Google requesting (or recommending) webp format in order to reduce loading times when doing speed tests with lighthouse. So people start to use and store images in webp format. Then to convert them back to jpg or png just to output these as webp again makes no sense at all.
  2. Just to append since this seems to be a rather common question (now knowing what I had to look for) and perhaps this may be useful for others. I found a suitable and convenient solution for this by using InputfieldSelectize and "Multiple Sortable Options". It's easy to add names for blocks/fields and make an output based on the given order ?
  3. That helps a lot already and very much answers my question, thank you!
  4. I am a bit lost, probably just because I do not exactly know what to look for. I want to give an user the opportunity to change the order in which the fields of the template are rendered. To keep it simple an easy example like to switch between the main text field, a slider and an image, so the user can chose freely which is on top, in the middle and at the end. Of course I could just add some kind of number field to determine the order like "1 for on top, 2 for the middle and 3 for bottom", but this both ugly and not very intuitive. However, for some reason this feels like reinventing the wheel again because I can't imagine there are not more sophisticated methods, settings, options, whatever..., I plain may have overlooked so far. Perhaps someone can point me into the right direction.
  5. That indeed did the trick and is what I was looking for. So it was neither the pastefilter nor the purifier. Thanks for enlightening me ?
  6. After already having some issue with video embedding I switched my attention to be able adding (font awesome) icons. However, something seems to be going absolutely wrong here, even when (temporary) disabling purifier and pastefilter (or editing pastefilter removing "i=em") a source code insertion like this: <i style="font-size:24px" class="fa">&#xf042;</i> becomes <em class="fa" style="font-size: 24px;"></em> so for some reason these settings are obviously not applied. Using current 3.0.229 and corresponding TinyMCE rich text editor version 6.4.1. What did I miss?
  7. All except: Your browser does not support the video tag. Everything is kept once Purifier is disabled. Having source and video in the pastefilter whitelist doesn't make any difference for me ? Edit: something seems to be going absolutely wrong here, even when disabling purifier and pastefilter or editing pastefilter removing "i=em" a sourcecode insertion like this: <i style="font-size:24px" class="fa">&#xf042;</i> becomes <em class="fa" style="font-size: 24px;"></em> so for some reason these settings are obviously not applied. Guess I am opening another topic for this issue.
  8. Thanks, and yes, I was in the module settings and I've also seen the pastefilter. Nevertheless I tried that idea, but as I was afraid this seems to have no effect at all. Checking again what is written in the template regarding the pastefilter: For some reason the github link I added in my first post was removed: https://github.com/processwire/processwire-requests/issues/226 in which there is a request for making the purifier to configurable, but I don't fully understand this, therefor my request here.
  9. This would be the included version 6.1.5 And yes, I've been using CKEditor so far as well, but regarding the age of the included version and the annoying handling of extensions/plugins I thought to give TinyMCE a try in my new project and I am quite satisfied so far. Well, there is no such setting (or I must have missed it), there are some settings which make sense like invalid styles and tools to be removed from the toolbar to make it usable in PW without the user having a chance to confuse things, but nothing like whitelisting specific html. Also the pastefilter whitelist, but I want to make use of the media tool (button) from TinyMCE, which just inserts the corresponding html5 code. Besides, I am pretty sure it is in the purifier because it seems to be no problem when disabling it- which I don't want to for obvious reasons.
  10. I'm still learning and reading, and I haven't yet figured out how to really configure the html purifier. For now its bothering me that media elements (such as video) are plain stripped out (added with TinyMCE), so in order to be able using these it seems I need to whitelist those manually. After some reading I found this github topic, but I'm not sure yet how to really use that information, so perhaps someone can enlighten me which steps I have to take and someone can give me a more detailed instruction how and where to really add these hooks, and/or if and how it is maybe possible to switch to the in the topic mentioned html5 version of it?
  11. Sorry to bump this old post, but it's actually something I just came across myself now. Are there any news/change/plans about this? Webp as valid input imageformat appears to be useful nowadays.
  12. Now we are talking, that is what I wanted to find, thanks a lot!!!
  13. I usually tend to avoid js if possible, but the idea to use it here definitely makes sense. Not what I had in mind in the first place, but good approach, thanks ? Edit: However, this doesn't really help to place it freely with CKEditor somewhere into the page, which is something people often expect since this is more or less a basic functionality they know from systems like WP. I think I can create this myself though.
  14. I have been digging for a while, but I didn't find a user friendly image slider. Is there something somewhere already?
  15. Thanks! I have to admit I am still a little confused with all options and especially selectors. I tried through a lot of things to get the working of all of it.
  16. for anyone digging such a thing, I mostly solved it now by using "renderNavTree($page.." instead of "renderNavTree($page->rootParent..." in basic-page and using parents() additionally: // cycle through all the items foreach($items as $item) { if (renderParent && $item->id == wire('page')->id) { $SkipLevel = 1; // Skip homepageroot foreach($item->parents() as $pitem) { if ($SkipLevel) { $SkipLevel--; continue; } $out .="<ul><li class='parentnav'><a href='$pitem->url'>$pitem->title</a></li>"; } $out .="<ul>"; } ... only need to make it render 1st level of parentRoot yet ?
  17. Just wanted to add that I was able to solve it with WireFileTools just fine. Thanks a lot!
  18. Ok, I am absolutely sure I am missing something simple again, I also read a few more or less similar topics here, yet I couldn't find an answer. I am using pretty much the original function renderNavTree: function renderNavTree($items, $maxDepth = 0, $fieldNames = '', $class = 'nav') { // if we were given a single Page rather than a group of them, we'll pretend they // gave us a group of them (a group/array of 1) if($items instanceof Page) $items = array($items); // $out is where we store the markup we are creating in this function $out = ''; // cycle through all the items foreach($items as $item) { $pageid = wire('page')->id; // markup for the list item... // if current item is the same as the page being viewed, add a "current" class to it $out .= $item->id == wire('page')->id ? "<li class='current'>" : "<li>"; // markup for the link $out .= "<a href='$item->url'>$item->title.$item->id.$pageid</a> "; // if there are extra field names specified, render markup for each one in a <div> // having a class name the same as the field name if($fieldNames) foreach(explode(' ', $fieldNames) as $fieldName) { $value = $item->get($fieldName); if($value) $out .= " <div class='$fieldName'>$value</div>"; } // if the item has children and we're allowed to output tree navigation (maxDepth) // then call this same function again for the item's children if($item->hasChildren() && $maxDepth ) { if($class == 'nav') $class = 'nav nav-tree'; if ($maxDepth > 1 || $item->id == wire('page')->id) $out .= renderNavTree($item->children, $maxDepth-1, $fieldNames, $class); else { foreach($item->children as $childitem) { if ($childitem->id == wire('page')->id) $out .= renderNavTree($item->children, $maxDepth-1, $fieldNames, $class); } } } // close the list item $out .= "</li>"; } // if output was generated above, wrap it in a <ul> if($out) $out = "<ul class='$class'>$out</ul>\n"; // return the markup we generated above return $out; } but I want it only to render the children of the selected page. Right now the output is like that (having lets say "child2 of child1 selected): Parent Page Parent child 1 child of child 1 child2 of child 1 child of child2 Fine so far and looks as wanted- BUT - problem appears if having more than one child of parent- it looks like this: Parent child 1 child of child 1 child2 of child 1 child of child2 of child 1 child 2 child of child2 child2 of child2 while I only would want it to render the tree of child 1, not of child2. Since all are children of Parent (hence same wire('page')->id), I can't distinguish it with id, but what else can I do here? Ok, I realized that this question is maybe confusing, what I wanted to archive is that only the navtree of the selected page is being rendered, nothing else (well if being absolutely perfect maybe 1 level of rootParent also).
  19. I want to use the WireFileTools $files->find function, but no matter what I try I only get a server error (either error 500 or "Call to a member function find() on null"). If my understanding of the docs is right, I only need to call it with $files->find($somepath); - but is there some include, some init or something else needed? Obviously I am missing something, maybe someone can enlighten me.
  20. Thanks, but its not images for the most part, it's mostly .zip and .7z files- other than that this method would be really nice ? After some more reading WireFileTools seem to be able to do what I need, but I am unsure yet how to use it. I'll ask in another post about it.
  21. I have a page I want to migrate to PW and it contains big download sections with hundreds of files. The files are in directories on the server already, what is the best approach to get them in a page? Is there some method I missed? Are there any plugins? Or would it be best to do with a filemanager for ckeditor? Any advice is very welcome.
  22. Thanks! I came across this page already and none of the mentioned things have been working. That's why I was asking here, I assumed there could be some kind of setting in PW I missed maybe. Of course it is possible that such changes are not supported by the server, but then I am wondering how other tools like Wordpress are bypassing such limits. Either way, if this is really just being limited by PHP settings I still can contact my server host. Any more information is very welcome ?
  23. Using the files field I came across the limitation: "File is too big - maximum allowed size is" - in this case 32MB - when trying to upload a file. Where is this limit defined, can it be increased? I read some, but couldn't find a specific answer.
×
×
  • Create New...