-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
Cross referencing a similar topic with, possibly, an answer to your question @Spiria
-
Exception SQLSTATE[HY000] [2002], SSL encryped database connections
kongondo replied to Lutz's topic in General Support
Cross referencing a similar topic with, possibly, an answer to your question @Lutz -
Hi @Melakh, Welcome to the forums. Sorry, not an answer to your question. However, since this question has been asked two or three times before, but without a solution, I am going to be naughty and tag probably two of the most knowledgeable people in these forums with respect to databases. Sorry both! @BitPoet, @LostKobrakai, for tagging you like this. Could you please weigh in on this issue if you can? Many thanks. ? Here are two previous similar questions:
-
JavaScript to the rescue ? Have a look at this: Intl.DateTimeFormat https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat and in particular this example in SO: https://stackoverflow.com/a/34602679 const tz = Intl.DateTimeFormat().resolvedOptions().timeZone As usual, won't work in all browsers, you know, the usual suspects... ?
-
Not sure I fully understand the scenario, however, technically, there is no 'adding children to a page'. Conversely, you give a child a parent ?. This means, there is no difference between creating a parent page and its children except for specifying the parent. // create parent $p = new Page(); $p->template = 'basic-page'; $p->parent = $pages->get(1234); $p->title = 'Parent Page'; $p->save(); // create child $c = new Page(); $c->template = 'child-template'; $c->parent = $p;// new parent above $c->title = 'Child Page'; $c->save(); It seems to me though that your question is mainly related to getting info to create the child page after some event has occurred? if that's the case, please provide more information about the form submission and handling process.
-
Alternatively, you could use ProcessWire's API $files https://processwire.com/api/ref/wire-file-tools/ To find files in a folder, you can use $files->find(); https://processwire.com/api/ref/wire-file-tools/find/
-
Excellent! Glad it worked. By the way, if your articles don't change often, you could cache the results of DOMDocument operations so that subsequent article index are fetched from the cache instead. Whenever an article changed, you would call DOMDocument again and then cache the new output. Have a look at WireCache here if this might be of interest: https://processwire.com/api/ref/wire-cache/
-
I have read this several times and it's not sinking in. It seems to me though that you are probably over complicating the logic? Maybe best to break this down and get the functionality sorted first then adding to it. Suggested: Get the selectors right. I'd even do this on a template without any CSS, a blank page and Tracy keeping me for company. Am I getting the correct results? Is the ajax working OK? Still on a blank page, selectors to return paginated results. Do these methods work? PaginagedArray https://processwire.com/api/ref/paginated-array/ Bring in MarkupNav (or your own if custom). Does it work? https://processwire.com/api/ref/markup-pager-nav/ Do the footer search. Check Tracy to see if inputs are getting mixed up, etc.. If everything works, bring in the CSS and real template file ?
-
No, sorry. You'd have to code that yourself. What's your use case? Welcome to the forums ?
-
Your text is a string, not an object That's what the error is about. You can use PHP's DOMDocument Class and the method getElementsByTagName(). Here's a tutorial (with a h2 example :-)): https://codingreflections.com/php-parse-html/ I am not sure about performance issues with the class if it has to parse lots of text/HTML.
-
Hmm. That's very strange. I'll have a look. Thanks for reporting.
-
Get template in InputfieldFile::fileAdded hook
kongondo replied to DrQuincy's topic in API & Templates
I understand how this can be tricky. One way to find out what's available is to go down the rabbit hole. In your case, you are dealing with the class InputfieldFile. So, using the search in the API docs here: https://processwire.com/api/ref/ to look for 'inputfieldFile' would bring you here (the API docs for the Class): https://processwire.com/api/ref/inputfield-file/ Going through those docs, there is no method or property directly dealing with templates or pages. However, this is a derived class, so the parent class could help. Looking at this ubiquitous note on this page: We might be able to get something in the parent Class, Inputfield: https://processwire.com/api/ref/inputfield/ So, we head over there and reading through, we find this under Other: ? -
This is unusual. How does your setup look like?
-
Get template in InputfieldFile::fileAdded hook
kongondo replied to DrQuincy's topic in API & Templates
I am not sure you can, directly (but others can confirm this). You can get the name of the field though, and its templates. However, couldn't you just get the page being edited and get its template? -
Yes. There have been issues this week. I can't find the post now but it was reported that the site was undergoing an upgrade.
-
Prevent saving a page if it was changed in the meantime
kongondo replied to MoritzLost's topic in General Support
Or if you really want to annoy the heck out of 'em...you can go with something this silly ? -
My hunch is that this is the reason. I don't think I ever tested MB with url segments. I'll have to look into this. Not sure when though, sorry. By the way, although the option to use HTML in the title is available, I'd encourage you to use the method getMenuItems() instead (in your template file). It is much more powerful and will give you full control over the markup.
-
Glad you find the module useful. I am not sure I understand this statement. By, "custom item", do you mean external links? (e.g., processwire.com). If not, please explain. Thanks.
-
I am not seeing those errors in my test site. But I do see some code that could be refactored. Please try the following for now: Replace this (starting from line # 915) $list = array( $posts->title => array('published' => $qn['blog-post'], 'unpublished' => $qn['unpublished'] ), $comments->title => array('approved' => $numApproved, 'pending' => $numPending, 'spam' => $numSpam ), $categories->title . ' & ' . $tags->title => array('categories' => $qn['blog-category'], 'tags' => $qn['blog-tag'] ), ); With this: $postsTitle = !empty($posts->title) ? $posts->title : "Posts"; $commentsTitle = !empty($comments->title) ? $comments->title : "Comments"; $categoriesTitle = !empty($categories->title) ? $categories->title : "Categories"; $tagsTitle = !empty($tags->title) ? $tags->title : "Tags"; $list = array( $postsTitle => array('published' => $qn['blog-post'], 'unpublished' => $qn['unpublished'] ), $commentsTitle => array('approved' => $numApproved, 'pending' => $numPending, 'spam' => $numSpam ), "{$categoriesTitle} & {$tagsTitle}" => array('categories' => $qn['blog-category'], 'tags' => $qn['blog-tag'] ), ); Please let me know if it helps. Thanks.
-
See my answer to your similar question here:
-
URL to any viewable page outside your admin: // same page const url = "./" // another page - relative path const url = "/parent/child/settings-page" // another page - full path const url = "www.mysite.com/some/viewable/page"
-
Check out olive. It's awesome and fast! Congrats! ? How did you implement this finally?
-
MySQL 8 compatibility and MariaDB replacements
kongondo replied to MoritzLost's topic in General Support
@adrian has an experience or two with this. Hopefully he reads this ?