-
Posts
76 -
Joined
-
Last visited
Everything posted by rooofl
-
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!
-
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.
-
Thank you! I “solved” the problem by adding a line to the .htaccess and hiding the 404 notifications on the notification module parameters.
-
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 ?
-
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.
-
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/
-
This request was aborted because it appears to be forged
rooofl replied to bubu2110's topic in Getting Started
Same error for me, it ended up being a attempt to connect with http instead of https. -
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));
-
That solution works! Thank you!
-
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.
-
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)
-
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.
-
Yes, I just did that, adding noTrim to the FormBuilder field as well. But the issue still exists. My logs:
-
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?
-
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
-
Using Custom Find to get a simbling repeater values
rooofl replied to rooofl's topic in General Support
Thank you all for all your answers. This is perfect, I even have the choice! Problem solved. -
Using Custom Find to get a simbling repeater values
rooofl replied to rooofl's topic in General Support
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? -
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?
-
`$svgFont->filename` solved it! Thank you very much for your help @monollonom!
-
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!
-
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!
-
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.
-
Hook: adding an image to an existing image gallery
rooofl replied to rooofl's topic in API & Templates
Thank you @BitPoet this makes totally sense, I should have thought about that. That solved my issue and I am super happy. -
Hook: adding an image to an existing image gallery
rooofl replied to rooofl's topic in API & Templates
Thank you for letting me know about wire('log'), it is much more handful that the way I found to debug. This is what my $image object looks like. I can’t find any documentation about this object and how to find the image url (for instance), or anything else to give to add(). InputfieldFormBuilderFile Object ( [data] => Array ( [label] => In use image [description] => Test desc [icon] => [notes] => [detail] => [head] => [required] => 1 [requiredIf] => [collapsed] => 0 [showIf] => [columnWidth] => [skipLabel] => [wrapClass] => [headerClass] => [contentClass] => [textFormat] => 4 [renderValueFlags] => 0 [prependMarkup] => [appendMarkup] => [formID] => 1 [entryID] => 0 [processor] => FormBuilderProcessor Object ( [data] => Array ( [id] => 1 [saveFlags] => 9 [skipSessionKey] => [formName] => new-inuse [submitText] => Submit [honeypot] => [turingTest] => Array ( ) [emailTo] => [emailFrom] => [emailFrom2] => [emailSubject] => Form Submission [responderTo] => [responderFrom] => [responderSubject] => Auto-Response [responderBody] => [successUrl] => [successMessage] => Thank you, your form has been submitted. [errorMessage] => One or more errors prevented submission of the form. Please correct and try again. [action2] => [action2_add] => Array ( ) [action2_remove] => Array ( ) [action2_rename] => Array ( ) [akismet] => [allowPreset] => [savePageParent] => 1006 [savePageTemplate] => 43 [savePageFields] => Array ( [name] => related_font [1] => title [114] => in_use_image ) [savePageStatus] => 0 [framework] => Basic [fbForm] => FormBuilderForm Object ( [forms:protected] => FormBuilderMain Object ( [formNames:protected] => Array ( [1] => new-inuse ) [database:protected] => WireDatabasePDO Object ( ) [filesPath:protected] => /site/assets/cache/form-builder/ [config:protected] => Config Object ( [data] => Array ( [dbName] => velvetyndev [internal] => 1 [urls] => Paths Object ( [data] => Array ( [wire] => wire/ [site] => site/ [modules] => wire/modules/ [siteModules] => site/modules/ [core] => wire/core/ [assets] => site/assets/ [cache] => site/assets/cache/ [logs] => site/assets/logs/ [files] => site/assets/files/ [tmp] => site/assets/tmp/ [templates] => site/templates/ [fieldTemplates] => site/templates/fields/ [adminTemplates] => wire/templates-admin/ [AdminThemeUikit] => wire/modules/AdminTheme/AdminThemeUikit/ [AdminThemeReno] => wire/modules/AdminTheme/AdminThemeReno/ [AdminThemeDefault] => wire/modules/AdminTheme/AdminThemeDefault/ [FileCompilerTags] => wire/modules/ [PageFrontEdit] => wire/modules/Page/PageFrontEdit/ [ProcessPageView] => wire/modules/Process/ [ProcessPageSort] => wire/modules/Process/ [ProcessPageSearch] => wire/modules/Process/ProcessPageSearch/ [ProcessPagesExportImport] => wire/modules/Process/ProcessPagesExportImport/ [ProcessRecentPages] => wire/modules/Process/ProcessRecentPages/ [ProcessHome] => wire/modules/Process/ [ProcessModule] => wire/modules/Process/ProcessModule/ [ProcessPageEdit] => wire/modules/Process/ProcessPageEdit/ [ProcessTemplate] => wire/modules/Process/ProcessTemplate/ [ProcessPageLister] => wire/modules/Process/ProcessPageLister/ [ProcessLogger] => wire/modules/Process/ProcessLogger/ [ProcessForgotPassword] => wire/modules/Process/ [ProcessPageAdd] => wire/modules/Process/ProcessPageAdd/ -
Hook: adding an image to an existing image gallery
rooofl replied to rooofl's topic in API & Templates
Thank you for your answer and for pointing my mistakes! Here is an updated code with a new error. Somehow add() refuse the $image object: $forms->addHookBefore('FormBuilderProcessor::processInputDone', function($e) { $form = $e->arguments(0); if($form->name == 'new-inuse') { $font = $form->getChildByName('related_font'); $fontName = $font->attr('value')->name; $fontPage = wire('pages')->findOne("name=$fontName"); $image = $form->getChildByName('in_use_image'); $fontPage->of(false); $fontPage->in_use->add($image); $fontPage->save(); } }); Error: Exception: Item added to Pageimages is not an allowed type (in wire/core/WireArray.php line 286) How can I make sure $image is a valid image object? I tried to echo $image->url but nothing is happens.