Jump to content

rooofl

Members
  • Posts

    79
  • Joined

  • Last visited

Everything posted by rooofl

  1. Thank you @wbmnfktr for your answer. I think it is a bit more complicated than I thought. I understand what you wrote, and it totally make sense, but I think the economy will choose for me : keeping the markdown field as it is. However, I just discovered the module InputfieldEasyMDE, and that might be what I am looking for, as it keeps the markdown field content and just adds formatting options on a icon bar.
  2. Hello! I have a textarea field already full of Markdown content. My clients need it to have CKEditor on it. That may be a silly question, but I can’t figure out how to use CKEditor with Markdown. Is it possible to either: interpret Markdown in HTML on the fly, in the CKEditor field convert all Markdown in HTML so CKEditor fields show HTML as they are supposed to do (I guess) Thank you for your answers.
  3. This is a very uninterested question, as I am just curious about this topic. Is there any dynamic towards a possible integration of Activitypub with Processwire? Would it be possible to create sites and app with PW that can interact with the fediverse? This could be a plugin able to federate with the network (just like this wp plugin does), or maybe a deeper integration (retrieve specific content from other federations…). I am personally using Mastodon and Peertube a lot since 5+ years and I think this is a great part of what remains of the cool Internet. I also feel an important technical gap between building website and creating federated apps, maybe for a good reason! I am interested to know your thoughts,
  4. Thank you @Ivan Gretsky! Your ideas are what I was looking for. My goals are more for a user navigation perspective than SEO. Until now, this page can be reached only by modifying URL bar, but my clients do that apparently! (I do too sometimes). I think 2. is the best option for my case. Thank you again!
  5. I have made several websites with this kind of structure: home projects project1 project2 project3 In my cases, the home page lists all projects, so the home/projects/ page is a double of home’s function. What would be the best practice? create a list of projects specially for projects/ even if it does the same as home/ redirect projects/ to home/ (I found ProcessRedirects can’t do that as the page is already exists, but maybe I can force it with .htaccess?) something else? Thank you for your advice.
  6. Thank you! I “solved” the problem by adding a line to the .htaccess and hiding the 404 notifications on the notification module parameters.
  7. The page /in-use/ exists, but those URL feel like a collage of many data types of the website, complete nonsense, they obviously not exist on the server. However, I found that the error also mentions "amazonbot": Referer: unknown Useragent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 (Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot) IP: 3.224.220.101 Page: Unknown User: guest The IP is also always different. And similar errors with Page: Unknown are being triggered almost every time without clear Page or Referrer. I have the feelings that bots are trying to reach pages that doesn’t exist. My PHP logs are ful of this kind of warnings. What should I do at this point ?
  8. Hello, every ~5 seconds I have a 404 warning notification that appears on the admin pages. It says: 404 occurred: /in-use/aaaaa-atelier.org/www.aaaaa-atelier.org/www.aaaaa-atelier.org/aaaaa-atelier.org/fiskprojects.com/aaaaa-atelier.org/aaaaa-atelier.org/aaaaa-atelier.org/fiskprojects.com/fiskprojects.com/www.aaaaa-atelier.org/www.aaaaa-atelier.org/stud 10 secs / expires 20 secs As you can see, the URL is very strange, and I have no idea how to solve this request (is it a request?). It lasts since months now and it is very overwhelming. I have `$config->debug = false;` Any help welcome.
  9. rooofl

    Velvetyne

    Hi all, This is our new website, still based on Processwire since 2015, we are very happy to be able to work with such a good piece of software. Thanks everyone for the support. https://velvetyne.fr You can read more about this new version here https://velvetyne.fr/news/new-website-v3/
  10. Same error for me, it ended up being a attempt to connect with http instead of https.
  11. Let me ask another question: could it be possible to log in JavaScript, the path of a file that just has been Ajax uploaded without saving the page? I tried that with no result: let uploadField = document.querySelector('#Inputfield_webfont_archive') uploadField.addEventListener("AjaxUploadDone", (e) => console.log(e));
  12. That solution works! Thank you!
  13. I think both works, and my issue is more about retrieving this value once the pages is saved and reloaded: $this->wire('log')->save('vtf_custom', $this->wire("config")->js('mySettings')['foo']); returns “bar” as expected, but there is still no trace of “mySettings” in the js object ProcessWire.config when I log it.
  14. I am trying to use $config->jsConfig(). A very basic module I crafted does that after a page is saved: $this->wire('config')->jsConfig('mySettings', [ 'foo' => 'bar', 'bar' => 123, ]); … and the same module has a JS file that tries to get those data back: (right now I am sticking to the doc’s exemple as you can see) var mySettings = ProcessWire.config.mySettings; console.log(mySettings.foo); console.log(mySettings.bar) But that last JS returns “mySettings is undefined”. That is where I need some help. More generally, Is this the best way to deal with php <—> JS data interchange, considering my goal is to fill a field with js generated content with a URL from an upload field as parameter: Upload field in page edit -> fileURL -> javascript doStuff(fileURL) -> fill a PW field with the result of javascript doStuff(fileURL)
  15. I tried using leading invisible characters or even visible ones, but trim() seams to transform 1 2 into 12 for the first line of the content.
  16. Yes, I just did that, adding noTrim to the FormBuilder field as well. But the issue still exists. My logs:
  17. Hi @Robin S and thank you for your hook, it appears to be exactly what I need. However, after some tests, the checkbox appears, the field is logged as noTrim = 1 with wire('log'), but the textarea content leading white spaces are still removed. Is there something else I should check? Currently, I have zero formatter and the content type is text. Field Object ( [id] => 160 [name] => ascii_drawing [label] => [flags] => [type] => FieldtypeTextarea Object ( [data] => Array ( [inputfieldClass] => InputfieldTextarea [contentType] => 0 [htmlOptions] => Array ( ) ) ) [data] => Array ( [inputfieldClass] => InputfieldTextarea [contentType] => 0 [collapsed] => 0 [minlength] => 0 [maxlength] => 0 [showCount] => 0 [rows] => 5 [noTrim] => 1 ) ) Edit: The field is use with the FormBuilder module, maybe the FormBuilder associated field also trims the content?
  18. I have a text field and I need its value to preserve all white spaces, especially the one ahead all text content. Is that possible? What I get when I <pre> the output: 1 2 3 What I need 1 2 3
  19. Thank you all for all your answers. This is perfect, I even have the choice! Problem solved.
  20. Thank you for your answer! If I understand correctly, you are referring to the Repeater item labels, where I currently have the {title} as value, to show the item’s titles as field name? I don’t understand that part, what is the page reference exactly?
  21. In a page’s admin interface, I need a select field to be populated with the values of another repeater that exist in the current page. To create such a reference, I tried to use Edit Field > Input > Custom Find, and Selector String. But I struggle to pass the “this page” reference. Ideally, I would like to find `$page->font_style`, `font_styles` being the repeater I want the values from. What am I missing?
  22. `$svgFont->filename` solved it! Thank you very much for your help @monollonom!
  23. After some tests, following your recommendations @monollonom, I face this error: Warning: XMLReader::open(): Unable to open source data in /home/…/www/site/templates/lib/EasySVG.php on line 161 It appears the path of `$svg->setFontSVG($fonturl.".svg");` is wrong, or at least not accessible by XMLReader. I checked: the file is readable. I also tested setFontSVG on a template file, it worked (can access to the SVG font and display the generated SVG). Finally, I tested with a static SVG font file to avoid the for loop, but it wasn’t able to open it neither. Here is my code in ready.php: <?php require './templates/lib/EasySVG.php'; wire()->addHookBefore("Pages::saveReady", function(HookEvent $event) { /** @var Page $page */ $page = $event->arguments(0); if($page->template->name !== "font") return; // or whatever if(!$page->webfont_archive && !$page->text) return; // file and text inputs $archivePath = $page->webfont_archive->path; $archiveUrl = $page->webfont_archive->url; $files = glob($archivePath . '*.{svg}', GLOB_BRACE); $len = count($files); for ($i = 0; $i < $len; $i++) { $fontpath = $files[$i]; $fontpath = substr($fontpath, strlen(wire()->config->urls->root)); $fontname = basename($fontpath, ".svg"); $fonturl = $archiveUrl.$fontname; echo $fonturl.".svg"; $svg = new EasySVG(); $svg->setFontSVG($fonturl.".svg"); $svg->setFontSize(100); $svg->setFontColor('#000000'); $svg->setLineHeight(1.2); $svg->setLetterSpacing(.1); $svg->setUseKerning(true); $svg->addText("demo text"); list($textWidth, $textHeight) = $svg->textDimensions("demo text"); $svg->addAttribute("width", $textWidth."px"); $svg->addAttribute("height", $textHeight."px"); // $page->svg_text = $svg->asXML(); // textarea input $page->svg_text = "test"; // textarea input $event->arguments(0, $page); } }); Any help welcome!
  24. Thank you very much for your inspiring, and detailed answer @monollonom I am going to make some tests very soon, also I didn’t know the existence of inputfield-runtime-only it solves a blurry area in my view of the process!
  25. Hi! We are Velvetyne Type Foundry, since 2010, we’ve designing and distributing free and open source typefaces. We are a non-profit organization. We are quite famous in the world of type design and open source design. We are currently working on a new website. We are focused on performances, and we want to show our fonts as SVG and not webfonts on our home page. Our website is currently using Processwire, and we want to stick to it because it’s amazing. I (author of this post) will take care of most of the development. We need a plugin that is able to generate an SVG path from a font file (present on the server), and a text. This script already does that pretty well and I think it can be a strong base for the font-to-SVG operation. We just want the admin page to be very user-friendly, taking care of the call to the font to SVG script and show its output. I wonder if anyone is able to do such a plugin an how much it can cost. Let me know if you can be interested.
×
×
  • Create New...