-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Return content from certain template but only from child pages
adrian replied to Franko's topic in API & Templates
Oh I see, so your selector is relative to PageA and PageB as the current $page ? In that case this should work when run from PageA or PageB: foreach($page->children() as $c){ or foreach($page->children("template=basic-page") as $c){ Do the "Child Pages" ever get loaded by their URL? If so and because they have the same basic-page template, you need to do something else to prevent them for looking for child pages. You could simply do: if($page->numChildren()>0){ foreach($page->children() as $c){ } Or perhaps it would actually make more sense to have a separate template for the PageA and PageB parents? Lots of options really -
Return content from certain template but only from child pages
adrian replied to Franko's topic in API & Templates
Well I think this should work: foreach($pages->find("template=basic-page, parent!=/") as $c) That will get all pages with basic-page template but without home (/) as their direct parent. Of course this won't work if you end up with further levels of child nesting. But right now, Page A and Page B should be excluded by this. -
Return content from certain template but only from child pages
adrian replied to Franko's topic in API & Templates
Sounds a little confusing - all pages, except Home, are child pages of something, so it all has to be relative to the parent page you're interested in. If you know the parent you can do: foreach($pages->get("parent=xxxxxxx")->children() as $c){ Maybe if you provide the page tree structure for us we can help figure out an efficient way. -
tobaco - thanks for the comprehensive report. I have tested the module with standard language support, but never with "Languages Support - Page Names". Sorry, multi language stuff is not something I ever use, so I am a bit ignorant of it I'm afraid. Is it common practice for the field for the default language to be empty by default? Not sure about the roles issue - creating new users and roles this is a relatively new feature for Migrator - I'll need to see if I can replicate the error you got. Would it be possible to send me the json file from your export so I can see how the role was defined during export? I'll look into the Edit Imported Content issue - again that is a relatively new feature and I think some more recent changes might have broken that - hopefully should be an easy fix - just a session variable issue.
-
NooseLadder - the link to the module the horst provided is designed primary to migrate page content and as a result it also grabs changes to fields and templates that are used by these pages. You can use the "Changes Since" option during export to grab all the changes to your site since that date/time and things should work as expected. The one thing thing that might seem confusing is that if you only make changes to template or field settings, you still need to export a page/pages that contain these templates/fields to capture these changes. Mindplay's work in progress module might also be useful here: https://processwire.com/talk/topic/2117-continuous-integration-of-field-and-template-changes/ although his is only about field/template changes. Personally I can see using both options depending on the needs. I still don't consider Migrator release worthy, so you should definitely test the import to a test PW installation before trying it on your live site. I do hope to get it finalized sometime in the next few weeks or so..... There are some small outstanding issues (like template context field settings) and also I need to test support for all the new pro fields which I haven't done yet. One thing I really need is help testing it
- 3 replies
-
- 2
-
- update site
- localhost to live server
- (and 1 more)
-
I can't tell for sure what the problem is, so I think you should try to simplify things down and debug each variable to figure out where things are going wrong. Bring it back to this: foreach($page->children("category=$input->urlSegment1") as $preview){ echo $preview->title; } Things to check are that the name of the category field is correct. Remember this must be the name of the field that is used in the template on the current page and not the name of the parent page that houses the child categories. Also try echo'ing $input->urlSegment1 to make sure it actually contains the name of the category you are looking for. If not you can firstly replace this with a hardcoded category name to make sure your selector is working, then track down why $input->urlSegment1 is not being populated. Hope that helps to get you sorted.
-
Sorry, when you say: do you mean that the rss feed itself is not updating, or that IFTTT is not sending the changes to FB?
-
Well Ghost gets great reviews: https://ghost.org/ It's free if you're selfhosting. But then again, you could also bootstrap PW into the site and use k's blog module still
-
Is this a trick question http://modules.processwire.com/modules/process-blog/ http://modules.processwire.com/modules/blog-profile/
-
Just a quick reply to let you know that it's already possible to upload an image to processwire from an external URL using the API. It is as simple as: $page->images->add('http://www.mysite.com/images/image.jpg'); Of course there is more work needed for doing this from the admin. This post might prove helpful: https://processwire.com/talk/topic/417-extending-image-field/
-
Sorry - you're right - I was kinda wondering why your question was in this thread - I didn't think it would make a difference if it was an ordinary images field or a CropImage field, but it does I am sure apeisa will get back to you shortly on this.
-
Default View set to grid works here and the toggle at the top right of the field when editing a page also works just fine. There were some updates to this functionality introduced in the dev version fairly recently, but that was to do with when there was only one image. I don't think anyone has ever reported the default view not working before.
-
Here are a couple of relevant hooks for file uploading: Pagefile::install InputfieldFile::processInputAddFile If you don't already know about it, this should be helpful: http://processwire.com/api/hooks/captain-hook/
-
Hi Alex, Welcome to PW! I can't tell from your question exactly how you are trying to set up the CKEditor field, but there are two steps. You need to create the field as a "Textarea" field on the Basics tab and then choose CKEditor from the Inputfield Type on the Details tab. If this is what you are trying and CKEditor is not an available option there, please let us know and we'll try to help you figure out what the problem is.
-
Before your foreach, add this: $field->addOption('Please Select'); Then to force it to automatically select the member_page contract field do: if($member_page->get('contract')->id) $field->attr("value", $member_page->get('contract')->id);
-
Finding the last page number for pagination?
adrian replied to GuruMeditation's topic in General Support
This solution from diogo looks clean and logical: https://processwire.com/talk/topic/1074-get-total-pages-pagination/?p=9411 What have you tried that didn't work? You can also get the count of pages like this: $num_pages = $pages->count("selector"); Then obviously divide this by the number of items you are displaying on each page and then ceil() the result. Although this option would require a second query to the database, so go with the first option if you can. -
Glad it works for you now! PW should be adding a number to the end of the name to avoid conflicts. When you say this doesn't work for you, is it with all names, or only with names with cyrillic characters in them? BatchChildEditor uses a custom naming method if the Overwrite Names option is checked in the module config, but if adding or overwriting, it uses the built-in method. What happens if you use the Add option and create to child pages with the same title - does the number get appended to the second child's page name?
-
Github issue opened: https://github.com/ryancramerdesign/ProcessWire/issues/520
-
Hey Joss, Not sure, but I just tested here on 2.4.4 and it's working fine, so I don't think it is a general problem. What's your JS showing? Any errors there? EDIT: Probably not likely, but any chance this might be the issue: https://processwire.com/talk/topic/6017-image-drag-drop-not-working-for-me-24/?p=58914
-
Sorry Jonathan - I have played with some of these tools a bit in the past, but never really figured out which were best so I can't really offer any advice. I guess ideally I'd like to see options for lossless and lossy. It's strange I have always thought of PNG as a lossless format, but I know that things have changed on that front.
-
This theme requires PW 2.4 because of the new "theme as a module" system.
-
Hanna Code & Page numbers (possible bug)?
adrian replied to GuruMeditation's topic in General Support
Could be totally off here, but have you tried start=0 in the selector in your hanna code? -
Hey Wanze, Just a small thing Could you please have the chart color config setting also control the color of the bar graphs throughout the module, rather than just the jQPlot charts? Thanks.
-
Hi jacmaes, I have tracked down the issue. It is definitely a bug that should be reported to Ryan on Github. There are newly added checks for module permissions around line#457 of Modules.php (https://github.com/ryancramerdesign/ProcessWire/commit/2c0762d1f346a3f01171b4f65fa97242f17fd916#diff-995c5c9ce48d4bff459f52363c6e190eR457) The module that is blocking your access is actually ProcessPageSearch, which required page-edit permissions, which of course a guest user doesn't have. If you temporarily remove the permission check, or change the ProcessPageSearch permissions to page-view, it works again (obviously this is not the appropriate solution . Once that hack is in place though, there is one other new bug: {"errors":["Field 'it' is not allowed in queries"]} This can be fixed easily by adding this line to ServicePages.module inside the loop starting at line#174 foreach($k as $name) { if($name=="it") continue; //add this line Let us know if you want us to submit an issue of Github, or if you have taken care of it.
-
Wow horst - just WOW! Once again, thanks for the amazingly detailed testing and for making the results available for all of us to see in such a well formatted and documented way!