-
Posts
11,097 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
I had a similar situation the other day with a gmail smtp setup. The test connection worked fine, but the email didn't send. Turns out the test worked with a few different config setups, but the email only sent with one specific setup. So I think a successful test connection is not always a guarantee that everything is set up correctly. Not sure that your module can do anything about that though.
-
I am not totally sure why you have the child Home page. If it's just to get it to appear in the front-end menu, then there are much better ways. $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='active'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; }
-
I don't think you can change that setting in your template because it is already loaded. I think the best approach is to add the following to the top of the template file that is being appended. if($config->ajax) return; or instead you could use: if($useAppended) return; and then in your template files you could do: if($config->ajax) $useAppended = true; Lots of options really
-
Check out the image version, also from blad: https://processwire.com/talk/topic/7379-module-alternativegridimages/
-
I am still not 100% clear, but it sounds to me like maybe you don't want a new way of storing product/price info, but just a new way of entering it. It sounds like you still want the data stored in the product's page fields. Is that correct? If so, you might be looking at implementing something custom with AdminDataTable (core module often used by other modules), or HandsOnTable. Here are a couple of links for inspiration: http://modules.processwire.com/modules/data-table/ https://processwire.com/talk/topic/4147-excel-like-crud-in-pw-using-handsontable/ and of course the ProTable field type. I think with ideas from those you could build a process module that builds an editable table using the product/price info from the fields from product pages. When saving the table, the data would be written back to the appropriate pages. Am I on track at all?
-
Great work Steve - this is one of my pet peeves too - I can never understand people's laziness when it comes to typing their name correctly. I have a couple of different stores that would definitely benefit from this!
-
There is actually some pretty good documentation in the first post of the VIP support board for the Table field, so once you have purchased and have access, all the info you need is available, although I agree it should probably be available here: http://processwire.com/api/modules/profields/table/ so the people considering purchasing it can get a better idea of how the API side of things works.
-
I am actually not sure on what it will and won't accept, but I know it accepts template and name - presumably it accepts most/all other selectors as well. Maybe someone else will know for sure.
-
It's missing a semi-colon at the end of the if($pic .... line.
-
One thing that would be very helpful is if you can provide the exported JSON (or full zip package if that is relevant) that is causing issues when you import - this will make it much easier to debug. Thanks again!
-
Hi @jlahijani, I haven't done much on it for a while now. I did think that most bugs were sorted by now though. The biggest remaining issue (I thought) was page fields and how to handle them if their content pages are in a page tree that is not part of the exported parent. At the moment they are exported and recreated on the destination site as a child of home, which obviously may not be ideal, so I think I need to add some additional logic to recreate the entire tree above the page field parent (if it doesn't exist on the destination site), although I can see this being problematic too. Since you've been testing lots, I'd love any thoughts you might have on the best way to handle this. Also, please send through all the details of the errors you got while testing - it will be a huge help I am sure. As for Wordpress vs Processwire - are you wanting to feature Migrator's use as an importer of WP content (using Nico's plugin), or just its ability for migration of PW content from one site to another? If the former, then I think that functionality should be pretty robust. Anyway, please let me know what you have uncovered - it would be great to get this to the next level!
-
This suggests to me that everything is set up ok from the apache side of things. Have you tried a fresh install of PW on this server to see if that goes ok? Maybe it will report what the problem is?
- 19 replies
-
- 1
-
-
- virtualhost
- apache
-
(and 3 more)
Tagged with:
-
Have you gone through the list on Nico's troubleshooting page? http://processwire.com/docs/tutorials/troubleshooting-guide/
- 19 replies
-
- 1
-
-
- virtualhost
- apache
-
(and 3 more)
Tagged with:
-
This is put together very quickly, but should work ok. If the user is logged in, but they don't have page-edit permission, and they try to load any page with the admin template, they will be redirected to the site's homepage. Of course you can tweak these as needed. <?php class HideBackend extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hide Backend', 'summary' => 'Redirect guest user from backend admin back to site\'s homepage.', 'href' => '', 'version' => 1, 'permanent' => false, 'autoload' => 'template=admin', 'singular' => true, ); } public function init() { if($this->user->isLoggedin() && !$this->user->hasPermission("page-edit")) { $this->addHookAfter('Page::render', $this, 'redirect'); } } public function redirect(HookEvent $event) { if($this->page->template == "admin") { $this->session->redirect("/"); } } }
-
Sorry you are having such a rough time of it - it can seem like voodoo sometimes Have you tried a simple index.html file in the root of a virtual host DocumentRoot directory? Does that work? Is it just a PW install that is giving you the 500 error? I could be completely off, but is it possible it's the period in your site2.dev folder name? PW has this restriction, although it is for dirs "beginning" with a period, so probably not. # ----------------------------------------------------------------------------------------------- # Access Restrictions: Keep web users out of dirs that begin with a period # ----------------------------------------------------------------------------------------------- RewriteRule "(^|/)\." - [F]
- 19 replies
-
- virtualhost
- apache
-
(and 3 more)
Tagged with:
-
Need to password protect your site? http://mods.pw/7o | Want to make sure page names match titles? http://mods.pw/7n
-
I actually can't see why your original code isn't working. I often use that approach: https://processwire.com/talk/topic/7700-find-image-by-image-name/
-
Creating User with already hashed password
adrian replied to blackeye1987's topic in API & Templates
I am not sure I understand completely. Are you actually wanting PW to store the password as plain text, or just return the password as plain text before hashing and saving?- 5 replies
-
- usercreation
- api
-
(and 2 more)
Tagged with:
-
http://stackoverflow.com/questions/3579072/php-fileinfo-is-undefined-function
-
Ryan does like his beer
-
Well I was actually creating a module as you spoke, but not for this Sounds like a cool idea, but I really have to focus hard on some real work for a while, so it might not be me that takes this on I'm afraid, as much as I'd love to
-
Updating fields via AJAX on the rendered page
adrian replied to statestreet's topic in API & Templates
Well all those lines are doing is getting the page object based on the id that is being sent via the URL, then turning output formatting off (standard procedure before saving a page), setting a field called "checked" to "1" which is the checked status for a checkbox, and then saving that field on the page. I don't expect this code will be an exact solution for you, because I don't know exactly how you have things set up. It was just designed to give you some ideas. If you provide more details, I am sure we can give you more complete - that is if you can't work it out yourself first - it's always good to try first -
Session variable getting lost after $session->redirect()
adrian replied to thetuningspoon's topic in API & Templates
I have had some similar issue and hacked around them also. Never really tried to figure out the root cause or come up with something that was repeatable enough to report. -
Might be unlikely, but what if a bot decided to hit 1000's of random pages on your site looking maybe for admin access or something - then your redirects database table would be full of all these entries - could get messy!
-
It's just that the ability to assign icons to modules is a relatively new feature and those modules haven't been updated to add the icon yet. You should perhaps file separate requests on the github pages for each module. That said - are you really giving the client access to the Setup menu?