-
Posts
1,554 -
Joined
-
Last visited
-
Days Won
48
Everything posted by gebeer
-
Unfortunately this is not well documented in the API reference?
-
You can send an $options array with the render method and use that in child.php So in your Hanna code echo $child->render(array("useMain" => false)); Then in child.php before your other markup <? if(isset($options['useMain'])) $useMain = $options['useMain']; // this will give you false when rendered from Hanna code ?> and somewhere in the top area of your your _main.php <? if(isset($useMain) && !$useMain) return; ?> This will take care of not rendering _main.php
-
@Fantomas @Batyr Place this at the top of your .htaccess and try again SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 This should make $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] available in fastcgi/cgi environments. It works in my server setup. Please report back if this fix also works for you.
-
@Fantomas Is you server setup Apache with PHP running in fast cgi mode? Then $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] will not be populated. I just setup my tutorial in a fast cgi environment and could reproduce your problem. I also found the problem and a possible solution and will implement that into the Rest.php gist and let you know once it is updated.
-
@Fantomas can you post your request header please?
-
very good writeup and great website! Would you be willing to share your rsync setup for uploading changed files? I love rsync and use it a lot. Does your setup connect to git commit in any way?
-
if ($prod->images) will always return true, since your images field can hold more than one. Use if ($prod->images->count) instead. That should resolve the error for empty image fields.
-
@Karl_T Glad it works. Using markup regions implies the use of the delayed output strategy. So your good to go ? $useMain was introduced in the advanced site profile that ships with PW and has been around for quite a while. Since many people adapted that, you see $useMain mentioned a lot throughout the forum. But it has nothing to do with the API.
-
PW is still supoorting it if you are using the delayed output strategy in your templates. $useMain has become kind of a convention when using this strategy, but infact, it is just a user defined variable. You could call it $includeMain or whatever you want. How I use $useMain: 1. in my _init.php I define $useMain = true; So it is true by default and the _main.php will be appended to all template php files. In the top area of the _main.php I do somethinmg like this if(!$useMain) return; // if $useMain is set to false in a template php file, then do not render _main.php Then in the template where I don't want _main.php to get appended, I set $useMain = false; In your case, when you don't want to have _main.php appended for AJAX calls you can do this in the template that receives the AJAX request if($config->ajax) $useMain = false; Of course this concept only works for the delayed output strategy.
-
@Zeka you need to go to Gmail settings and allow access for less secure apps there. Then it should work.
-
I am right now working on a quite similar project. In my case I import from an XML that I get through an API and populate product pages, check for there status etc. I can encourage you to go on the way you started. It is all pretty straight forward and nice to handle with the PW API. Your import code looks basically fine. So you shouldn't have major problems there. I set up a process module that creates a page in the backend where admins can manually trigger imports. If you would like to go that route, there is a skeleton Hello Process module that you can use and @bernhard wrote a great article on building admin pages with process modules. I find this approach much cleaner than doing all the logic in a template file. Regarding your concerns Use lazy cron module for automation. Each time you get a new JSON, loop through it and compare it to the single-movie pages you have and act on them (modify/delete) or create new ones. You can use custom fields on the single-movie template to store that Have a look at https://github.com/webcreate/infinite-ajax-scroll You can use kongondos Blog module or at least get a lot of inspiration from it ;-)
-
Inputfield dependencies - documentation is up to date?
gebeer replied to zota's topic in General Support
What makes you think that this is an ongoing work? I have used the techniques outlined in that post in many occasions and it works fine, be it in the admin or even on the frontend with forms built by API. EDIT: As long as your using the default admin theme you should be fine -
Up until now not one of the many softwares on github that I have been using even had branding attached. With pro modules the user knows exactly what to expect: buy and then use. With free modules that ask for money to remove brandings, the user could feel tricked. I'd rather prefer that for the same reason mentioned above. I happily pay for pro modules and use them a lot. I totally respect the way you see things in this matter and it is your freedom as a module developer to handle things like you do. Just wanted to share my thouights and feelings about it and explain some negative views people might have on your approach, especially since it is the first time I come across this in the PW module world. Enough said. Thank you for everything you're giving to the community and keep up the great work!
-
Hi, just wanted to share something I came across while working on an import module for XML data from a web service. The XML I got was not huge, but still, loading around 3.5 MB of XML with 250+ large child nodes into memory at once with simplexml_load_file() and then looping over it had significant impact on performance. I searched for a solution and found this great article about how to parse large XML files. It basically explains how to utilize the native XMLReader class together with SimpleXMLElement to handle such situations in a memory efficient way. After implementing it I got a significant improval on perceived performance. No comparison in numbers to share here as I'm a bit short on time.
-
I wouldn't consider forking an open source project and amending it to one's need as bad karma at all. This is what places like github, gitlab etc. is all about. I have to agree with @Robin S For me personally, it feels wrong having obligatory powered by links in a free module in the PW universe. You see that very rarely here. It is more common on other platforms, e.g. Joomla, and this was one of the many reasons that drove me away from there. Most of my clients do not accept links like that on their website. Contacting the developer to have this removed would cost extra time, both for me and the developer. So why not make it optional in the first place? I understand that this is a way to generate backlinks which generate traffic which generates attention and ideally more jobs which in the end generate money. But, again, it does not feel right to me to use a free PW module for that purpose. I totally appreciate the time that developers spend on releasing free modules and this is the spirit that makes projects like PW stand out. To generate income from a module one can always release a paid version. Free versions shouldn't have any strings attached.
-
Sorry, I have no idea what else could cause this. Maybe someone else can jump in?
-
Then try this: RewriteBase / If it is not working, try this: RewriteBase /processwire-master/
-
Did you set the RewriteBase in the .htaccess?
-
You can use a hook in ready.php to delete cache on save of pages // delete caches when pages are created, saved or moved around wire()->addHookAfter('Pages::save', function(Hookevent $event) { $page = $event->arguments(0); // do nothing on admin pages if($page->template == 'admin') return; // delete cache for templates if($page->template == 'where-to-go-detail' || $page->template == 'our-guides-detail') { $this->cache->delete('wtg'); // here you could add logic to rebuild the cache } });
-
what does this say when you put it before everything else? var_dump($modules->isInstalled('FormTemplateProcessor'));
-
don't you get anything from the var_dump?
-
I just set this up on my dev install 3.0.96 with your code from above and it works. Only thing I changed is $form->parent... So it is hard to say what goes wrong on your end without seeing the complete template code. EDIT: what does this say? $form = $modules->get('FormTemplateProcessor'); var_dump($form); And then right before your echo? var_dump($form); echo $form->render();
-
and this is definitely wrong $form->parent = $page('template=book-now'); // wrong $form->parent = $pages->get('template=book-now'); // should work
-
what happens if you comment out the first call to $form->render?
-
The error message you posted does not fit with the code. You got that error when you tried it with render(array('name','email','body',)) What error do you get with the actual code that you posted? EDIT: Sorry for that