-
Posts
1,459 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Ivan Gretsky
-
Hello! How is going? I am confused how to update pim2 from PW (or really anywhere). Currently I got both pim1 and pim2 installed, but only pim1 is shown in ProcessWireUpgrade with the version 2.1 while pim2 is 2.7. Is there a proper way to handle this?
-
Get $page->created as Unix timestamp
Ivan Gretsky replied to Ivan Gretsky's topic in General Support
Yep, already there thanks. -
Get $page->created as Unix timestamp
Ivan Gretsky replied to Ivan Gretsky's topic in General Support
Unix timestamp should be the same on any server, shouldn't it be ? Anyways, what should I check to make php and mysql consistent? -
Get $page->created as Unix timestamp
Ivan Gretsky replied to Ivan Gretsky's topic in General Support
I am really confused here. Please be so kind to explain. When I get $page->created as a timestamp, should not it be the same as 11 digits not depending on any timezone? But when I create a new page and straight after that do something like this: echo time(); echo $pages->get(1053)->created; The first number is less than the second in an amount of seconds equal to an hour. I assume both of these numbers are UNIX timestamps and should be about the same, but they differ in an hour. -
Good day! I need to have $page->created as a UNIX timestamp (UTC) to compare it to time(). But I can't figure it out how to do it. I get the $page->created time in the future, later than time(). Please help!
-
There is no need for processwire:symlink task. Just use the built in deploy:shared task instead: <?php /** * Deployer ProcessWire Recipe * Version 0.0.1 */ require_once __DIR__ . '/common.php'; // ProcessWire shared dirs set('shared_dirs', ['site/assets']); // ProcessWire shared files set('shared_files', ['site/config.php']); /** * Main task */ task('deploy', [ 'deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:shared', 'deploy:symlink', 'cleanup' ])->desc('Deploy your project'); after('deploy', 'success'); And not sure config file has to be shared. Of course it is bad practice to store you db credentials in the VCS, but this file is quite essential for the PW site.
-
Hey, pleini! This is not about extending a class, but maybe an easier way to do what you need. If you got a reasonable need to have some method hookable and a module is maintained, you can ask the author to make it hookable. All module writers I have talked to tried to help me when I asked and almost all of them were friendly doing that)
-
Here in Russia we use Yandex Maps API, which is quite similar to Google's. I do not know how good is the coverage for all over the world (must be ok for some cases), but you can check it out. It is free (at least for now).
-
I think that you are right and there is no other way (at least that I know of). Some changes to working translations were introduced recently, so you have the option to only upload one csv file instead of many jsons. But I do not know of a language pack having such a csv yet .
-
I do not see a need for function here at all <?php // LIST PARTICIPANTS CHILDREN OF THIS PAGE $overviewchildren = ''; foreach($page->children as $participant){ $partnerID = $participant->partnerID; $overviewchildren .= '<div class="row">' . '<div class="col-sm-2">' . '</div>' . '<div class="col-sm-10">' . '<strong><a href="' . $participant->url . '">' . $participant->p_first_name . ' '; if($participant->p_middle_name) { $overviewchildren .= $participant->p_middle_name . ' '; } $overviewchildren .= $participant->p_last_name . '</a></strong><br />' . $participant->p_job_title . '<br />' . $participant->p_department . '<br />' . $pages->get("parent=1004, partnerID=$partnerID")->title . '<br />' '</div>' . '</div>'; } ?> But actually $participant->partnerID should be a Page Field so you can just write $participant->partnerID->title P.S. Note the use of get instead of find.
-
Load child page on parent page in modal box through ajax
Ivan Gretsky replied to ttttim's topic in General Support
This can be done with a redirect from child template. The redirect should also pass a parameter with child page id that should be caught in parent template and shared with js with something like this <php echo "<script>var modalPageId=" . $input->get->childPageId . "</script>"; Then you should check this variable in your javascript and fire a popup if it is populated. BUT! Do not do none of this cus it is bad for everything: SEO, usability, you name it. Just through a 404 on child pages. If you need direct link just include a get parameter. -
This is because of a variable scope. Use wire('pages')->find(...)... instead. See Ryan's explanation here.
-
Login with a link (is it called magic link?)
Ivan Gretsky replied to Ivan Gretsky's topic in General Support
Yes, that is the route I will probably take. I think about storing the token in the user template and use it only in pair with login. I am planning to use forceLogin to authenticate without password on condition if the token in the url matches the token stored in the user template. -
I would go with method 2 - let each person be a page on his own. That will make it easy for you to add properties (fields) for them in the future. For example, their performance stats or sоmething. You can use Page Table field (or RepeaterMatrix if you got ProFields) to manage all the team members on the same page, but it is optional. Each person this way can have an image field (gallery) on his own. You can get the first image from a person page on the team page to make a list of team members. I think it could beneficial for you to see the code of skyscrapers profile (live demo here). It is by Ryan and can open your eyes on quite a lot of ProcessWire possibilities.
-
As Schedule Pages module is based on Lazy Cron, I would probably either make a custom module that hooks Lazy Cron, or modify Schedule Pages if you need admin interface for it. Another idea is to write a trigger for IftRunner based on Lazy Cron and an appropriate action . I don't know if that can be done easily, bit that would be a "leaner" interface for site managers.
-
Login with a link (is it called magic link?)
Ivan Gretsky replied to Ivan Gretsky's topic in General Support
Just been there, thanks. I am hoping to find something on-site (or at least with an integration as a module) . P.S. And I think this link has all the rights to be here, Sergio. -
Good day! I am looking for a solution to do a login-with-a link functionality. A site should generate and send via email a link to a user. That link should contain (as I can imagine) a login and some kind of token. Following that link a user is able to get automatically authenticated on a site and view the page, otherwise inaccessible.
-
No need for repeaters here. Pages are the most common solution for most things and are a right choice for this case too. Make a dog template, create all the fields you need, assign fields to dog template. Place all dog pages under same root (something like dogs). You can configure all dog pages to be automatically placed under the dogs page on creation. If you got the budget get ListerPro for admin - it will make finding the right page in the admin a breeze. If you don't, you can create a custom Process module for that. For the frontend filtering take a look at skyscrapers profile (live demo here).
-
Is it called Aligator because it eats hell lot of memory or something? Jokes aside, why Aligator? Why with the single "L"? And you know my obsession... Can it render MenuBuilder contents somehow?
- 15 replies
-
- nested
- navigation
-
(and 2 more)
Tagged with:
-
Jeffrey is the man! He is doing something free for laracasts now, but his paid PHP Fundamentials are already a classic! If you can not buy the subscription - steal it from some pirate torrent or something ! P.S. Just kidding. You should not steal or attemp to get something for free which is not. It's wrong. Support the thing that you like instead! And go to pirate torrents only if you absolutely need something and have no chance to get some money to pay for it. And it is still no excuse though. P.P.S. Hope this little ad is some kind of excuse...
-
Goog day! I have a Page field inside a Repeater inside a Repeater (yeah, x2). I need to determine the selectable pages for that Page field via php code. But I do not have access to $page variable from there. I can access $pages though. Is there a way to get the $page edited value? I have asked a similar question about Page field inside a Repeater inside a RepeaterMatrix, but it is in a vip forum so has a) less chance to be answered quickly and b) less chance to help someone else. Just mention it not to be banned by the moderators . I checked and the same problem repeats in either case. Promise to post a solution to the other topic if we'll produce one.
-
redirect template without a .php file to it's parent?
Ivan Gretsky replied to John W.'s topic in General Support
I do not know why do you need it? Why not have 404 on something you don't want to show anyway? Why not have a php file to do what you need if you need it? You can build a separate page tree branch just for categories (for business-categories template pages) and connect them to end-level pages like ABC Fence with page field. In this case your end-level pages should have different template and can live under business-directory, while categories themselves are elsewhere as noted above. -
Strategy for user-created data storage
Ivan Gretsky replied to bmacnaughton's topic in API & Templates
What are you suggestions about it? Only use selectors based on path? -
You just might want to consider putting this kind of stuff in your build chain with the autoprefixer postcss plugin (which is in the heart of mentioned editor plugins) so you don't need to manually run it in your editor every time.