Jump to content

Sanyaissues

Members
  • Posts

    122
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Sanyaissues

  1. being 1033 the page with the children you want to get: //Given than child only returns a single page, you can use sort,to for example get the newest child of 1033. $pages->get(1033)->child("sort=-created, include=hidden");
  2. pages(1040)->title; $pages->get(1040)->title; $pages->findOne("id=1040, include=hidden")->title(); Here's an example dumping the title property and the status of my Demo, hidden page.
  3. T_CONSTANT_ENCAPSED_STRING happens because there's a string that is not properly enclosed within quotes. In your case I'll start by disabling the Media Lister module. If the error goes away, check for any unusual characters in your media files names or tags, that might be causing the problem when the module processes your files (just guessing here). Also check the code in the ProcessMediaLister.module file around line 486 for any unclosed strings or issues with quotes (or share with us more info of the error)
  4. Yes we can @SIERRA. Introducing: Fluency. The complete translation enhancement suite for ProcessWire.
  5. @protro are you using any hook to generate images? I'm guessing here, but the behavior and logs suggest me that the slow issue is because your machine processing the images generation, probably not related with profields at all. Maybe similar? For the cache, try this https://processwire.com/modules/process-cache-control/
  6. But the real question @bernhard is: Did the spambot find an answer to its 404 error, or is it doomed to wander the digital void, searching for a purpose it can’t quite find? I like to live in a world where bots can improve themselves thanks to human forum answers.
  7. Webmin + Virtualmin: for web hosting management (I was a plesk user until I found webmin). Analytics: GoatCounter: No tracking analytics for simple (and usually personal) websites. Plausible: Self hosted non Google analytics.
  8. @BarryP In ProcessWire, when a page is loaded, it calls a template file located in the `/site/templates/` directory. You need to find the template with that image (maybe `site/templates/home.php`, `hero-banner`, `section-intro`...) and check why there's no value for the `src` (aka: the reason why your image is broken).
  9. @7Studio What about an Amazon lightsail linux instance? Maybe you can try with a 2GB virtual server (they give you 3 months for free). Ubuntu or Amazon Linux instances with Webmin on top and auto backups on a S3 bucket will be cheap and pro.
  10. @François Lacruche you can read more about permissions in the post I linked before and security here: https://processwire.com/docs/security/ By doing `chmod -R og+rw site/assets` you added read and write permissions to `others` and `group`. The recommendation is: 0755 for directories: 7: Owner (full control: read, write, execute) 5: Group (read and execute) 5: Others (read and execute) 0644 for static files: 7: Owner: Read and write permissions (rw-) 4: Group: Read permissions (r--) 4: Others: Read permissions (r--) So just to be sure, you can execute: `chmod 755 site/assets/` (permissions for directory) and then `find site/assets/ -type f -exec chmod 644 {} \;` (permissions for files)
  11. The main benefit of this thread is that I finally have a space to post in PW forums. I have this internal desire of being super active here, but as a forever-noob developer I can't participate in others people's topics. So, this post suits me hahaha. I have a secret: The infinite site hosting scheme. The only word in marketing that's more 'scheme' than 'scheme' is infinite. And when they combine infinite and secret, you can know you've officially landed in the Promised Land.
  12. I tried a few more tests, and in my case, deleteAll() works every single time. But it seems like is a good idea to enable trackChange when modifying images. There are a few other examples in the forum, but they seem based on Soma's post. Hopefully someone else can explain us the why.
  13. Seems like after updating the DDEV instance some extensions were removed from the container, after reinstalling intelephense the methods are working. Thanks!
  14. Maybe try: $this->related_tutor->template->fields->skills->getLabel($user->language); Edit: looks like $user->language is the default, but give it a try
  15. Check this post from Ryan If test_image_field contains multiple images your code will work. As you can see in this test we deleted 3 items from the `image` field. And here's an example to delete the first image ("all images" in the case of a single image field) If the error persists please install Tracy, run this in the console and share me the ouput: $p = pages(9999); $p->of(false); d($p->test_image_field); $p->test_image_field->deleteAll(); d($p->test_image_field); $p->save('test_image_field');
  16. Thanks @bernhard! rmf- suggestions are working for me. But I cannot find a way to see methods as createPage, deleteField as you do in your video. If you can point me in the right direction I would appreciate it.
  17. If you want to embed the PDF avoiding the browser's native PDF viewer you can use a third party service like smallPDF (easy way), or you can parse your own PDF and use your own viewer with something like PDF.js. You can even provide the document as Base64 instead of providing a PDF file (ninja way).
  18. Try this @Edward Ver: <ul class="menu-main md:text-[16px] text-[18px]"> <!-- Loop through each child of the homepage --> <?php foreach($children as $child): ?> <!-- Check if the child has sub-children --> <?php if($child->hasChildren()): ?> <li class="menu-item-has-children"> <a href="<?= $child->url ?>" class="menu_link "> <?= $child->title ?> <i class="text-lg icon-chevron-down align-[-2px]"></i> </a> <div class="w-full border-t-2 rounded-md md:w-9/12 sub-menu mega-menu border-rose-600 max-w-[1280px] "> <div class="list-item"> <ul class="grid grid-cols-1 gap-1 lg:grid-cols-3 megamen--seclevel lg:grid-flow-col md:grid-rows-1 lg:grid-rows-11"> <!-- Loop through each sub-child --> <?php foreach($child->children() as $subchild): ?> <li class="w-full"> <a href="<?= $subchild->url ?>"><?= $subchild->title ?></a> </li> <?php endforeach; ?> </ul> </div> </div> </li> <!-- If the child has no sub-children --> <?php else: ?> <li><a href="<?= $child->url ?>"><?= $child->title ?></a></li> <?php endif; ?> <?php endforeach ?> </ul> Or this alternative where the <li> for subchildren and non-subchildren is the same, but we apply different classes based on $child->hasChildren() output. <?php // Get the homepage $home = pages()->get('/'); // Get the children of the homepage $children = $home->children(); ?> <ul class="menu-main md:text-[16px] text-[18px]"> <!-- Loop through each child of the homepage --> <?php foreach($children as $child): ?> <!-- Apply 'menu-item-has-children' class if the child has sub-children --> <li class="<?= $child->hasChildren() ? 'menu-item-has-children' : '' ?>"> <a href="<?= $child->url ?>" class="menu_link"> <?= $child->title ?> <!-- Show dropdown icon if the child has sub-children --> <?php if($child->hasChildren()): ?> <i class="text-lg icon-chevron-down align-[-2px]"></i> <?php endif; ?> </a> <!-- Display sub-menu if the child has sub-children --> <?php if($child->hasChildren()): ?> <div class="w-full border-t-2 rounded-md md:w-9/12 sub-menu mega-menu border-rose-600 max-w-[1280px]"> <div class="list-item"> <ul class="grid grid-cols-1 gap-1 lg:grid-cols-3 megamen--seclevel lg:grid-flow-col md:grid-rows-1 lg:grid-rows-11"> <!-- Loop through each sub-child --> <?php foreach($child->children() as $subchild): ?> <li class="w-full"> <a href="<?= $subchild->url ?>"><?= $subchild->title ?></a> </li> <?php endforeach; ?> </ul> </div> </div> <?php endif; ?> </li> <?php endforeach; ?> </ul>
  19. Hi @Edward Ver don't worry, we are here to help you navigate PW! Here's an example for the menu you asked for: <?php // Get the homepage $home = pages()->get('/'); // Get the children of the homepage $children = $home->children(); ?> <nav class="menu"> <ul> <!-- Loop through each child of the homepage --> <?php foreach($children as $child): ?> <li> <a href="<?= $child->url ?>" class="menu_link"><?= $child->title ?></a> <!-- Check if the child has sub-children --> <?php if($child->hasChildren()): ?> <ul class="sub-menu mega-menu"> <!-- Loop through each sub-child --> <?php foreach($child->children() as $subchild): ?> <li class="menu-item-has-children"> <a href="<?= $subchild->url ?>"><?= $subchild->title ?></a> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> </nav> The code wasn't tested but it should work.
  20. Hi @bernhard. I'm about to try rockmigrations, I already saw your videos (amazing job, thank you!), poke the docs and read a few posts on this thread. But there's something I'm wondering: Let's say we have a clean PW installation and we want to create a page (dar) with the template (doo) and two fields (foo & bar). What "workflow" will you follow to deploy them? My first guess: 1. On migrate.php we create the page, template and fields: 2. We create /site/classes/DooPage.php to define the settings for the doo template: - Is that approach Ok? Any tips? - After the page, template and fields were created, it's Ok to leave the "creation" instructions on migrate.php? Any risk of conflict with the instructions on DooPage (in my example I defined different titles for the foo and bar fields)? - How can I see the RM methods using the vscode snippets? Thanks.
  21. Cool, add any updates here. But it looks like a permission issue with your /site/assets folder. Try: chmod -R og+rw /site/assets Or maybe you can restore the files and folders manually by going to drive.google.com and download the folder contents. Don't know how the sync works, but maybe your local files permissions are "screwed" but the files in the cloud version are Ok. Here's a related discussion you can read.
  22. Hi @François Lacruche, I assume you are running a website on your computer and when you synced the folder to Google Drive, the permissions of the folders/files got "corrupted". - Where are you seeing the "destinationPath is not writable" error? Please share a capture. - Is the site accessible? - Can you access the admin? Some possible solutions (just guessing here): - Try to set the permissions for the folders/files https://processwire.com/docs/security/file-permissions/#how-to-change-permissions-of-existing-files - What if you do a new Processwire installation in a new folder and after the installation is done, you copy the files inside the "corrupted: /site/ folder to the new installation?
  23. Hi @SIERRA The problem isn't related to putting the content inside Processwire templates folders or how you implemented the paidhai template. The paidhai template requires 417kb only for the CSS (plus 100kb of not used javascript) when loading the website. That's a lot. The solution is to deliver only what is required (css, images, scripts) and defer everything else. To understand what is really required on the first load you can use the coverage tool in Chromes dev tools: 1. Open the chrome dev tools (Shift + Ctrl + I) 2. Open the command menu (Shift + Ctrl + P) 3. Type coverage and select the show coverage tool Coverage can help you to understand which content was loaded but is not being used (aka: things that you can defer). As you can see in the picture, 567kb are being loaded, but only 67kb were needed to render the first content. I never used Bootstrap before, but in your case I will probably try to understand what CSS & JS content is really needed. - Does your website really require all the CSS files on first loading (popup, carousel modal-video, font-awesome)? - Can you defer or async the main.js and jquery.js files? or move them to the bottom of the <body>? - Can you bundle some Bootstrap files to decrease the number of requests? To solve it you can do what @AndZyk told you. Use Critical to extract, minify and inline the critical css, and then use preload to load all the other CSS files. Also, maybe Optimize can solve the issue for you.
  24. ProcessWire > 3.0.33 ? PHP >= 7.2.0 ? It's working @netcarver. Glad you got it. Thanks.
  25. Hi @netcarver,I'm running PW 3.0.240 here. When I was testing the 'requires'=> ['ProcessWire>3.0.33', $php_version] fix, I noticed that if I search the module from the directory, the error appears But if I try to install by using any of the other options: module from URL (https://github.com/netcarver/WireMailPostmark/archive/main.zip), from upload or manually the value renders without problem: ProcessWire>3.0.33, PHP>=7.2.0 (Before each test I deleted the module folder, clear the compiled files, hit the refresh module button, etc..)
×
×
  • Create New...