Jump to content

Zeka

Members
  • Content Count

    827
  • Joined

  • Last visited

  • Days Won

    7

Zeka last won the day on November 26 2019

Zeka had the most liked content!

Community Reputation

878 Excellent

About Zeka

  • Rank
    Hero Member
  • Birthday 04/12/1989

Profile Information

  • Gender
    Male
  • Location
    Kiev, Ukraine

Recent Profile Visitors

3,214 profile views
  1. Hi @joer80 Take a look at this thread
  2. @MoritzLost Thanks for the answer. You are right, I forgot to set namespace in init.php But it doesn't help, nom I get error Class 'ProcessWire\Products' not found I went through WireClassLoader.php and from findClassInPaths method in looks like the class name should be the same as its filename. So, I changed ProductsPagesType.php to class ProductsPagesType extends PagesType { /// } and then if I call it will work $products = new ProductsPagesType(); wire('products', $products, true); But I want to use "Products" and not "ProductsPages" or "ProductsPagesType" as classname and it look like the only way to do it via classLoader is to load it maually wire('classLoader')->loadClass('ProductsPagesType'); In this case even if classname is not equal to its filename like // ProductsPagesTypes.php class Products extends PagesType { /// } it will load it and I this code will work $products = new Products(); wire('products', $products, true); Am I right or I missed something?
  3. Hi. I have been using a module approach to include my custom Pages Types and other classes that extend Page class. In PW 3.0.152 we got the ability to specify custom Page classes without modules or manual include. So what I'm trying to do is basically load my custom pages types via classLoader. ProductsPagesType.php <?php namespace ProcessWire; class Products extends PagesType { /** * Construct the Products manager for the given parent and template * * @param Template|int|string|array $templates Template object or array of template objects, names or IDs * @param int|Page|array $parents Parent ID or array of parent IDs (may also be Page or array of Page objects) */ public function __construct($templates = array(), $parents = array()) { parent::__construct($templates, $parents); $this->addTemplates("products"); $this->addParents($this->pages->get("/products/")->id); } public function dumbMethod() { return 'test'; } } // init.php wire('classLoader')->addSuffix('PagesType', wire('config')->paths->classes); $products = new Products(); wire('products', $products, true); I get Fatal Error: Uncaught Error: Class 'Products' not found Autoload debug panel output: bd(wire('classLoader')); What I'm doing wrong?
  4. You can hook to pageNotFound // in modules init() $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'redirectToEnglish'); public function redirectToEnglish($event){ // some logic $this->session->redirect($yourpage->url); }
  5. @Confluent Design You can ask your question here https://processwire.com/about/contact/
  6. @celfred Try to use TracyDebugger https://modules.processwire.com/modules/tracy-debugger/ https://adrianbj.github.io/TracyDebugger/#/debug-methods
  7. @ottogal You can change default grid mode to "vertical list"
  8. This commit https://github.com/processwire/processwire/commit/7d5cef5717ef3150297f87829f03f9c4df5fa725 brings some improvements to overrides in context of repeaters, so it's not an issue in your case as it was commited in 3.0.144 Worth to ckeck JS errors on home page and also check that you have your settings in page source
  9. @2hoch11 Make sure that there are no overrides on the second template on template field context.
  10. Thanks, I know it. The issue is that somehow it worked before update with this option checked.
  11. @Gadgetto Have you seen this? https://github.com/processwire/processwire/blob/dev/wire/core/FieldsTableTools.php#L108
  12. @adrian Hi. I'm facing a small issue and I'm not sure that this one is relative to Tracy, but I feel that it's better to ask anyway. I have quite a simple template that outputs page views based on the GET parameters. URL of this page is /ua/views/. The issue is that I have significant and unreasonable leap in memory usage The strange thing is that if I change URL ( page name) to something else like v or view I get (if not contains 'views') I have reviewed all the code and did not find anything where occurs 'views'. I don’t have any idea what can cause it, it's just some kind of mysticism, so I thought maybe it could be an issue with Tracy or Performance Panel. Thanks.
×
×
  • Create New...