Jump to content

Sergio

Members
  • Posts

    537
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Sergio

  1. Yes, is not the best solution from a UX point-of-view. But I don't think that adding it below the title, as WP does, is the best way around. In most cases, we don't want the user to edit the page name by mistake. In your situation, I would take a look at @adrian's PageRenameOptions module https://modules.processwire.com/modules/page-rename-options/. Another option is to add a warning, using a hook, if the page title is edited to alert the user to also change, or check, the page name on the Settings tab.
  2. Yes, it's possible. Set $config->advanced = true; on your config file and a "System" tab will appear while editing the template. And there you can make the change. See screenshot. Similar thread:
  3. You can pass a "numPageLinks" option to the $page->render method, like so: $options = array( 'numPageLinks' => 10, 'nextItemLabel' => '<i class="uk-icon-angle-double-right"></i>', // 'nextItemClass' => '', 'previousItemLabel' => '<span><i class="uk-icon-angle-double-left"></i></span>', // 'previousItemClass' => '', // 'lastItemClass' => '', 'currentItemClass' => 'bg-orange', 'separatorItemLabel' => '<span>…</span>', 'listMarkup' => "<ul>{out}</ul>", 'itemMarkup' => "<li>{out}</li>", 'linkMarkup' => "<a href='{url}' class=''>{out}</a>", 'currentLinkMarkup' => "<span class=''>{out}</span>" ); echo $pager->render($posts, $options);
  4. <?php // did we find any matches? if(count($matches)) { // yes we did, render them echo ukAlert(sprintf(_n('Found %d page', 'Found %d pages', $matches->count), $matches->count), "default", "list"); echo ukDescriptionListPages($matches); } else { // we didn't find any echo ukAlert(__('Sorry, no results were found'), "danger", "warning"); } ?> After that, edit your language on admin and translate the strings on the search.php file. https://processwire.com/docs/multi-language-support/code-i18n/#plurals
  5. This MySQL uft8 collations comparison may help you: http://mysql.rjweb.org/utf8_collations.html Took it from here: https://stackoverflow.com/questions/2344118/utf-8-general-bin-unicode
  6. Wouldn't it be better to do something like: $news_full = $page->children("template=news, limit={$page->feed_count_full}"); $news_archive = $page->children("template=news, limit=50")->filter("id!=$news_full"); so you can keep a reasonable limit to the archive query, 50 for instance, instead of loading all the children at once?
  7. Sergio

    Looking for a new Job

    Best of luck on the job search, Soma! I hope you find a great place soon!
  8. Hi Moritz, I see. Without seeing your _init file, I wonder why did you set the default regions there opposed to set them in _main.php or other template that's appended and not prepended? As _init.php is prepended (as set in the default PW config file) the region's content will appear on all page before they are rendered, unless you replace that region on the 404 template file (basic-page), like: //basic-page.php <div pw-replace="footerinfo"> <!-- nothing --> </div> Using the debug, I can see it at the bottom of my 404 page. See that the first line shows the region I set on _init.php (copied from yours) and it being replaced on the third line.
  9. The 404 page uses the basic-page.php template file unless you have changed it on admin. Take a look at how Ryan implemented a PW region debug on the Uikit "Regular" site profile, it may help you figure it out: <?php if(config()->debug && user()->isSuperuser()): // display region debugging info ?> <section id='debug' class='uk-section uk-section-muted'> <div class='uk-container'> <!--PW-REGION-DEBUG--> </div> </section> <?php endif; ?>
  10. Thanks, my friend! Will test and let you know!
  11. Hey, @tpr did you have the time to check out this? Thank you!
  12. I think the problem is the strpos function. It will return true for "pdf" in "report_pdf" for instance. But we need to return true only if it's an exact match. So, what about this: foreach ($ignoredTemplates as $t) { if (preg_match('/\b'.trim($t).'\b/',$templateFile->filename)) { return; } } I tested it here and it works.
  13. Hey @tpr, I think I've found a bug. One of my pages was returning a black page and no error on debug/tracy. Data was passing fine. After 10 min trying several things here, like removing the template php file to test the error etc and nothing happened. The file was named pdf_report_pdf.latte and it was loaded by another template via viewFile method. I then went back to the module config and remove a "pdf" (just "pdf) from the list of templates to ignore as I have another template called pdf.php and voilà, the error was gone. So, I'm guessing you do a regex on the ignore list entries? Was that the problem?
  14. Check your .htaccess file. It may be wrong or not existing. Check also if the /processwire path is valid. It's the name of the page of ID = 2 on the pages table on the website database.
  15. Today's setup for multi-browser / OS testing. Chrome and IE11 on Windows and Safari on the Mac. (Beer not in the frame) ??
      • 7
      • Haha
      • Like
  16. WOW!! Jaw dropped here... I'm really impressed, David! This module and the admin settings you built look incredible. Dumb question: how did you create those matrix thumbnails?
  17. WOW! Way easier than I thought! Fantastic job! Thanks!
  18. I agree with you @bernhard, but I said so because it seems the specs are for a simple page (more like a read-only executive report), as far as I understand it. But for the case you mentioned, the admin page is the way to go! And thank you for the article, I'll be using its lessons to build a dashboard in the near future. ?
  19. I agree with Autofahrn, it seems that the logic should stay in the frontend as it will be easier to control and maintain.
  20. As you may not know the user name, create a file called "change_pass.php" on /site/templates. Put this on it: <?php namespace ProcessWire; require "./index.php"; $admin = $users->get(41); $admin->setAndSave('name', 'youNewUserName'); $admin->setAndSave('pass', 'yo123456'); Now, using a terminal, go the project directory and run the php file: cd myproject/ cd site/templates php change_pass.php Et voilà
  21. I would: Download the files and the database Run the site locally Reset the admin user Upgrade the site to PW 3+ Work on it
  22. Fear not! Reset it: https://processwire-recipes.com/recipes/resetting-admin-password-via-api/
  23. Yes: https://guidetodrawing.com/admin/ Hello and welcome to the forums! Once you access it, take a look on the page structure, see the templates and fields used and after that, the php files inside templates/.
  24. This module looks AWESOME, @Wanze !! Thank you, thank you, thank you! I'll test it on a new project ASAP to give feedback.
  25. Thanks @flydev ! Got it!
×
×
  • Create New...