All Activity
- Today
-
Nicole H started following $image->size(); configuration questions
-
Nicole H started following ImageFocusArea
-
@bernhard Yes, I know about it. However, I prefer not to use modules for these kinds of things, as my work approach would need to adapt to each module used. I am using Vite for these purposes instead. Before developing this script, I was using the AllInOneMinify module for ProcessWire. Later, I switched to JavaScript-based compilation solutions: First moved to Gulp with Browser Sync Then migrated to Webpack Currently using Vite Among these tools, Vite has proven to be the lightest solution, and I'm getting exactly the results I want with my Vite configuration. While using Vite, I wondered "Why don't I implement my own browser sync solution?" This led me to write this lightweight script, which works remarkably well. And I'm happy with this setup!
-
A very quick and easy solution would be to add css like this to your admin.less file: li.Inputfield_tmp2 input { margin-top: 30px; } Before: After: You need to adjust the field names in your css though.
- 2 replies
-
- multilanguage tabs
- multilanguage
-
(and 1 more)
Tagged with:
-
Does anyone have tips or css snippets they are using to get round this issue?
- 2 replies
-
- multilanguage tabs
- multilanguage
-
(and 1 more)
Tagged with:
-
elvina changed their profile photo
-
Thx for sharing! In case you don't know or anybody is interested in alternatives: RockDevTools is free and provides asset merge/minify plus live reload:
-
Ok. I found the problem. Just in case anyone runs into the same thing: I had an included .php file that was was loaded on the very beginning of my template. That file was coded in ANSI which caused the language string detection to break. Another ANSI coded include at the end of the template did not do any harm btw.
-
I have a strange behaviour that I do not understand fully. I have a couple of translatable strings in my template file: $Headline_1 = __("Headline1"); $Headline_2 = __("Headline2"); So when I click on "Find files to translate" this template is found, but only the first string is presented as translatable. If I change the line to $Headline_1 = __("Headline1"); //Test $Headline_2 = __("Headline2"); //Test Processwire also detects only the first string, but puts the rest of the code as comment. So obviously the system does not detect the line breaks. The file is in UTF without BOM, and had only CR as linebreaks. But changing them to CR/LF did not do anything. Did anyone ever encounter something like this, or can tell me where I overlook something crucial?
-
Hello, Welcome to the forum.
- Yesterday
-
This hook is used to monitor file changes and page updates in your ProcessWire project. It operates when debug mode is active and returns file changes and latest page update information in JSON format. The script hook is automatically injected before the </body> tag in your HTML. It periodically checks for any file or page updates in your system at the interval you specify. If the previous check time is older than the new check time (indicating changes), the page automatically refreshes. ~/site/ready.php if ($wire->config->debug) { $wire->addHookAfter('Page::render', function (HookEvent $event) { $script = <<<HTML <script> const browserSync = { mtime: 0, init() { this.sync(); }, sync() { fetch('/browser-sync') .then(response => response.json()) .then(data => { if (!this.mtime) { this.mtime = data.max; } else { if (data.max > this.mtime) { location.reload(); } } }); } }; browserSync.init(); setInterval(() => browserSync.sync(), 2500); </script> HTML; $event->return = str_replace('</body>', "{$script}</body>", $event->return); }); $wire->addHook('/browser-sync', function (HookEvent $event) { $wire = $event->wire(); $root = $wire->config->paths->root; $siteRoot = $wire->config->paths->site; $extensions = '*.{php,js,css}'; $paths = [ "{$root}src/{$extensions}", // custom composer package "{$root}src/src/{$extensions}", // custom composer package "{$siteRoot}{$extensions}", // ready.php, init.php, finished.php "{$siteRoot}classes/{$extensions}", // page classes "{$siteRoot}templates/{$extensions}", "{$siteRoot}templates/*/{$extensions}", "{$siteRoot}templates/*/*/{$extensions}", "{$siteRoot}templates/*/*/*/{$extensions}", "{$siteRoot}templates/*/*/*/*/{$extensions}", ]; $files = []; foreach ($paths as $pattern) { // Try with GLOB_BRACE first $result = glob($pattern, GLOB_NOSORT | GLOB_BRACE); // If no results with GLOB_BRACE, try without it if (!$result) { $result = glob($pattern, GLOB_NOSORT) ?: []; } $files = array_merge($files, $result); } $filemtime = 0; foreach ($files as $file) { if (!is_file($file)) { continue; } try { $mtime = @filemtime($file); if ($mtime && $mtime > $filemtime) { $filemtime = $mtime; } } catch (\Exception $e) { continue; } } $latest = $wire->pages->get('sort=-created|-modified'); $latestTime = $latest->modified > $latest->created ? $latest->modified : $latest->created; header('Content-Type: application/javascript'); echo json_encode([ 'max' => max($filemtime, $latestTime), 'mtime' => $filemtime, 'modified' => $latest->modified, 'created' => $latest->created ]); exit; }); } This development tool helps streamline your workflow by automatically refreshing the browser when you make changes to your files or content, eliminating the need for manual page refreshes during development.
-
was just about to delete my comment! I just realised that I hadn't updated the module. updated and all good, works as you say with pipe seperator in multi language field. Thanks so much!
-
@elvina - I am not sure if you will need textarea fields instead of text. I couldn't test text because they were broken for me in the Table GUI - I don't know why - maybe that's a question for Ryan. If you look at the code I added to support ML (https://github.com/adrianbj/TableCsvImportExport/commit/b1cf4b9d9c396f7f50e8a33a7b8ba871614a6f50), I think it should work fine for any text field. I assume you are separating the different values for each language with the multiple values separator and they are in the same order as the languages in the PW admin.
-
Hi. I'm just back on my importing with a multi language text field. I'm not sure I understand what you mean that I have a multi language text field in my table and it works to manually enter using the table GUI, but importing via CSV doesn't work. Are you saying I need to convert them to text areas?
-
Hello @Frank Vèssia Thanks for reporting this issue. Unfortunately I cannot reproduce this error in my console. size() and length should return the same. Take a look at this discussion. Could you please replace the size() function with length to see if the error is gone now. If so, I can replace it on Github too, because it should not have a negative side effect. Thanks Jürgen
-
There we are: https://ddev.readthedocs.io/en/latest/users/quickstart/#processwire-zip-file 💖
-
It helped me, Thank you so much.
-
nclm joined the community
-
I'm not sure, but I don't think it supports redirects for subtrees. But you could easily solve that by adding an url hook to /{year}/{page} That hook will not fire for /2025/... as this page exists, and for all other years you can make it look for the page at /oldyears/$year/$page and redirect to that page if it exists.
-
When having PagePathHistory module installed and moving a whole subtree of pages to a new location, should all the children get correctly redirected too? Old situation: - FrontPage -- /2024/ -- /2024/somepage/ -- /oldyears/ New situation: - FrontPage -- /2025/ -- /oldyears/2024/ -- /oldyears/2024/somepage/ What happens when accessing /2024/somepage/? I think it should be redirected to /oldyears/2024/somepage/, but I think it gives me a 404 error.
- Last week
-
Hello! Is there any way to force the recreation of the webp variation when the crop is edited?
-
Kevin Hayes joined the community
-
[SOLVED] How do I sort children pages by template?
virtualgadjo replied to Alpina's topic in Getting Started
Hi @AndZyk actually, the first thing i wuld think about is that when your post number grows, the two categories and tags folders will be a little less easy to find and modify but, honestly only an admin usability problem for me, the important thing is what you say about this url thing and not allowing url segments (no security issue with them if you use a simple regex to say what you allow and a simple die if somebody puts something taht doesn't match nor is in the retreived/checked arrays) as, i must be used to too complicated demands of categories and/or tags selections and most of all, even with simple ones the necessity to allow mutiple categories for one post, if only one category allowed by post i would simplify the structure with the one i showed in the previous one as yours 😄 in the end, when it comes to seo the real important thingis this only one url for a blog post whichever list/category/tag you're linking from and you are absolutely right, there no right or wrong structure, the only question for me is which one makes things the most simple to use depending on what you need (and, in a certain way, on who will use it, you and i are "a liitle" used to pw and its incredible features, it's not always the case of all the people we make website for and i tend to try and give them the most obvious admin i can, their love and addiction to pw will grow and let me be maybe a little more pw geeky along the website life 😄 Have a nice day -
Ah, thx! That's what I was missing 🙂 It returns only view links which I don't want either. Thx for the clarification 🙂
-
Does it return them with links to edit those pages, or just view them? For me it returns the view link which is fine.
-
[SOLVED] How do I sort children pages by template?
AndZyk replied to Alpina's topic in Getting Started
Thank you for your explanation @virtualgadjo. 😀 My preferred structure looks like this: Blog (template blog) Post 1 (template post) Post 2 ... Categories (template categories) Category 1 (template category) Category 2 ... Tags (template tags) Tag 1 (template tag) Tag 2 ... The templates categories and tags have no template file, but category and tag have one. The templates blog, category and tag have pagination enabled. The post template hast two page reference fields: Category (single selection) and tags (multi selection). This way there would be urls like: blog/post1 blog/categories/category1 blog/tags/tag1 My structure would not allow for a post to have multiple categories and disconnects tags from categories. Also I try not to use URL segments. That would be the main difference between your and mine structure. But of course there is no wrong or right structure. So everything is possible. 🙂 Have a nice day. -
teamgenkins joined the community
-
Thx @adrian that already helps! I missed that comment! This one is interesting. This is not the case for me! I'm also hooking Page::editable and Page::addable and the live search returns non-editable pages as well...
-
[SOLVED] How do I sort children pages by template?
virtualgadjo replied to Alpina's topic in Getting Started
hI, maybe i should explain a litte more 🙂 in the structure i use, blog posts are indeed children of the main blog page (and template, i'll go back to this later) and categories an tags are just a way to select which posts you want to display depending on url segments the important thing to me is that, whatever "list" you're coming from, domain/blog/ domain/blog/tag_n/ domain/blog/cat_n/tag_,n/ and so on, when you click o a post its url will alwasys be domain/blog/post_n, no duplicate content, url segments making easy to use back to the list link, bookmark (and are prettier than js url hash but those could be used too) now if you're sure (iron sure changing your mind would be painful to restructure), the posts will only belong to one category, @AndZyk's structure is a the best solution keeping only the tags outside the blog "folder" --- Blog -> template blog-index Category 1 -> template blog-category Post 1 -> template blog-post Post 2 Post 3 Category 2 Post 4 Post 5 Post 6 Category 3 Post 7 Post 8 Post 9 ... Tags -> template blog-tag-index Tag 1 -> template blog-tag Tag 2 Tag 3 ... @Alpina, well yes and no 😄 first of all think of the blog with 50 say 100 posts, coming into the admin to add a category or a tag, i don(t know why but i think you would be happy to find those "folders" outside the main blog one instead of having to look for it under a tide of posts, less clicks, best life :) and as pw makes my life (and my clients' one) so easy, i try to keep it this way 🙂 the other thing, and in this case i'm always thinking i'm making the website for somebody else, friend, or client and not for me..,. i'm a huge fan of the children tab features which template is allowed for parent/children, in this case, when my victime clicks on the new button of the blog parent the created child has a blog_post template without having to choose (and make potential mistakes) well you could say that setteing the category and the tag parent templates on can't be used for new pages it would work too but think about the previous point i spoke about i have maybe a strange habit but making a websit i always think - as if it is not for me (well that's mainly the case 🙂 ) - think of it not as it is just when i'm making it but a few months or years after being used, sort of a reality principle and when thnking about a structure, i'm under a storm of "what if...?" (and so are my victims :D ) there must be no exceptions, each exception becoming a rule, it makes things a liitle longer to decide but so more confotable to use afterwards... well i think i should call it a post :D have a nice day -
[SOLVED] How do I sort children pages by template?
Alpina replied to Alpina's topic in Getting Started
Hi @AndZyk, I may be wrong, but the main difference between my structure and @virtualgadjo is that categories and tags are children of /blog in my case, which is not in virtualgadjo's case. Am I missing something?