-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Three free modules that might be useful (to varying degrees) for your request to be able to preview changes: http://modules.processwire.com/modules/process-page-draft/ http://modules.processwire.com/modules/process-preview/ http://modules.processwire.com/modules/process-textarea-preview/
- 24 replies
-
- draft
- Pro-Modules
-
(and 3 more)
Tagged with:
-
Ok, it should be fixed in the latest version. This fix is only needed for PW 2.6.6+ but I think it should also work fine on older versions.
-
Actually the issue is not what I thought - it is a recent PW dev problem. I checked a PW 2.6.1 stable site and it works fine. I am not sure what has changed in PW dev to cause this - I will need to investigate further - hopefully I can find some time in the next few days to figure it out. EDIT: This is the PW commit that breaks things: https://github.com/ryancramerdesign/ProcessWire/commit/fd719abc6ad4dc12792592b6715f986d29af2625
-
Sorry about this Charles - I'll take a look a little later today or maybe tomorrow - I had a similar issue with CustomUploadNames which actually stole the "Add Category" code from this module. I'll probably just need to make the same changes I made to that, so should be a fairly easy fix.
-
Actually if you want it to save to the assets/files/pageid folder for the current page, this is what you want: $page->filesManager()->path(); But do you want to save it directly, or would you rather just add it to a files field for the page? $page->pdfs->add("invoice.pdf"); If you went that route you could do: $mpdf->Output('/tmp/invoice.pdf', 'F'); $page->pdfs->add("/tmp/invoice.pdf"); unlink("/tmp/invoice.pdf"); or something like that
-
-
It isn't installed by default, so just go to Modules > Core > Select Options and install
-
Hi @ArtArmstrong - thanks for your efforts with this and for sharing here. Just in case you missed it, the PW core now has FieldtypeOptions (http://processwire.com/blog/posts/new-options-fieldtype-processwire-2.5.17/) which is an enhanced version of FieldtypeSelect which works with InputfieldRadios, InputfieldChecboxes, InputfieldSelect, InputfieldAsmSelect, etc. Perhaps there is still an advantage to your module - I'd be curious to hear more. Thanks again!
-
How to get URL to template directory in global namespace?
adrian replied to Neo's topic in General Support
It's the same as wire('page') wire('config') Same goes for all PW variables (https://processwire.com/api/variables/)- 1 reply
-
- 1
-
I saw those two, but figured that since they are $pages->count() calls they wouldn't be a problem as they are not loading those page into memory - right ? Oops, they are count($pages....), rather than $pages->count(). Maybe that simple change would make a big difference.
-
I belie Unfortunately he already tried that based on my suggestion here: https://processwire.com/talk/topic/10609-processwire-site-header-and-footer-used-in-wordpress-blog/?p=100209 Are there any other places I have missed where adding a limit might help?
-
I am going to chime in and say that isn't really correct There are lots of acceptable ways to do something, but even as brilliantly thought out and architected as PW is, it doesn't prevent you from writing template code that results in slow/inefficient queries and also potentially dangerous holes that users could exploit. Keep in mind that there isn't any CMS out there that can prevent you from making these mistakes. PW makes it easy to do it the RIGHT WAY, but you still have to think things through, follow best practices, and if in doubt ask someone more experienced if you are doing it right, or at least make sure you are not doing it wrong!
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
Ok, good to know - I am not sure what the problem with the dashboard is. If you don't want the dashboard, I would consider doing the migration again without the blog module installed at all - I think its main benefits are setting up everything for you and also providing the example front-end markup code - great for PW newbies, but I don't think you need either of those things. This way you can start with a clean setup (no existing blog related fields or templates) and the migrator will take care of adding everything as needed. Then just write the template code to output the posts and you are good to go. You can even steal some bits from the markup code from the blog module if it helps.- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
What happens if you add a limit to the selector on this line: https://github.com/kongondo/Blog/blob/master/ProcessBlog.module#L825 Make it like this: $posts = wire('pages')->find('template=blog-post, include=all, sort=-blog_date, parent!=7, limit=10');- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
Sorry you are having issues with the blog dashboard. As I mentioned, I don't use it, so I am not sure how it works or what might be causing this issue. I saw your posts in the blog thread - hopefully you will get some help over there. Do you have debug mode on? Any errors there or in your php error log? It might be useful to start inserting some log statements in this method: https://github.com/kongondo/Blog/blob/master/ProcessBlog.module#L798 to see where things are getting to. There is a loop that iterates through all posts. I would also maybe start commenting out sections in this method to see if a certain chunk of code is to blame for the timeout. There is also some code in that loop that checks for comment stuff. Did all your post comments import OK?- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
If you having issues getting this to work, I have posted two separate ways of doing this: https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/page-5#entry89599 and https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/page-5#entry89616 Pros and cons to each version, so you should read all the posts in between as well. Personally I would go with the second one, just be aware that if you want it to work on the front-end you need to consider the name of your form fields.
-
What are the rules under Input > Selectable Pages for the "coach_user" page field? Do they allow adding users?
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
Good to here - yeah, the migrator template and field name defaults are not matched up for blog module. I don't personally use the blog module (Kongondo has done an awesome job with it, but I don't need the dashboard and I prefer to set up manually to configure exactly to my needs). Also when migrating a WP blog, migrator by default, uses the template and field names that I prefer. When you get a minute, it would be great if you could put together some tips for other users based on your experience. I think it's a pretty powerful took for getting more people using PW, but I don't think it's getting that much use at the moment. I'd also love to here any suggestions that you might have for improvements.- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
But you're not calling the repeater field anywhere in your template code. I also don't understand why you have all these references to Wordpress paths under your assets directory. With a repeater field you want to be foreach'ing through each item in the field. Read the section "Outputting Repeatable Fields" on this page: https://processwire.com/api/fieldtypes/repeaters/ If you still can't get it to work, show us your new code and we'll help you along.
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
Because you are using the blog module you need to configure the MigratorWordpress plugin (Modules > MigratorWordpress) to use the field/templates/pages that module uses. The defaults for the module don't match, which is why it has created new ones. If you take a look at what was created by the blog module, and replicate those - eg "blog-post", instead of the default "post" then everything should work as expected. Remember this is designed to work without the blog module being installed - perhaps the defaults should match those used by the blog module. Let me know how it goes after tweaking those settings. You may want to set up another clean site so you have a fresh starting point until you get those config settings correct.- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
ProcessWire Site Header and Footer Used in WordPress Blog
adrian replied to quickjeff's topic in API & Templates
One more piece of advise - if the blog you are importing contains a lot of images, the import can take 10's of minutes, so be patient. I have also had some reports that in some cases the dev had to run the import twice to get everything to work - I haven't experienced this myself, but this is one of the reasons the module is not officially listed in the modules directory yet. As I get bug reports I am working to improve things, so please let me know your experience and any problems you have.- 25 replies
-
- caching
- header include
-
(and 1 more)
Tagged with:
-
Yep, that should do it. Take a look at the cheatsheet for learning about eq. You have three options for grabbing items from a PW array: ->first() ->last() ->eq(n) Typically with a slider you foreach through $page->images as $image, but it seems like you only have three images and you have distinct URL links for each one, so calling each one individually like you have might just be easier.
-
Hi @kradzcalypse and welcome to the forums. Instead of: $page->image->Slide1 what you are looking for is: $page->image->eq(n) where "n" is the number of the image in the image field, starting at 0. Since you named it "image" and not "images" is it set up to handle more than one image?
-
Try this: $authorID = $users->get($authorNameSanitiz)->id; You need to get the ID of the user, not the user object.