Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. @Peter, The select box is coming from the 4th argument of renderNav() $mobile. The default value is 'true'. Used in conjunction with CSS @media queries, the select box provides an easier navigation of your Blog for mobile devices. If you wish not to use it, just set $mobile=false. See below: renderNav() tutorial - I'll need to update this to be more explicit about this feature.. renderNav() code use with media queries example in blog.css demo file
  2. The link was meant to point you to more info . No problem with asking (especially if you've already attempted to solve the problem) . Is your question resolved then?
  3. Use count() to check if images present in a multiple images field...http://processwire.com/api/fieldtypes/images/ (it's an array). Otherwise it always returns true.. if(count($page->bfd_people_picture))
  4. @Andi, I am not sure I get your question but I think you mean in the modules list PW is listing Blog as 2.2.2 despite having updated to 2.3.0? Maybe PW's module cache didn't clear. In that case, hit the refresh button in PW Module list page. Otherwise, check the other module files, they should all be version 2.3.0.
  5. It's all here: http://processwire.com/api/variables/config/ $config->urls->abc return http paths; $config->paths->abc return absolute ones
  6. This $dir = $config->paths->site . 'templates' . '/' . 'bxsliderpics'; Can be changed to this $dir = $config->paths->templates . 'bxsliderpics';
  7. <ot>Now that's unfair...I have given you 2 likes in the space of 30 minutes; one for 'being wrong' (which is rare in itself) and one for 'laughing' </ot>
  8. @Soma, I am taking back my like in that case
  9. Maybe it's just me but I don't understand your question Page Field: What page field is this? Are you referring to an actual Field of the type Page? Instead of the number: What number is this? Is this an ID? A count? admin Page List: Are you talking about the Page Tree that in the admin that shows a list of your site's pages? Or are you talking about a list of pages selected in a Page Field that is visible when you editing a page using a template that has that Page Field? A screenshot would help
  10. Speaking of teachers...https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/
  11. Did you my edit in the post above yours about using PageTable with existing pages?
  12. Would this help? https://processwire.com/talk/topic/8177-page-table-howto/?p=81311 Meanwhile, you could try increasing the memory as well
  13. You might want to consider using PageTable.. https://processwire.com/talk/topic/6417-processwire-profields-table/?p=63119
  14. Here's one way to do it.. Create a folder 'tmp' in you /site/ directory. Copy your images in there. Careful if your images are huge in size! You might run out of memory... Run the following code in one of your template files...(this code could be further optimised..but you get the idea...) $p = $pages->get(1419);//page where we want to save our images //absolute path to a directory called 'tmp' within the site folder where we have our images $dir = $config->paths->site . 'tmp'; //if we found the directory (here we use Standard PHP Library (SPL)) if (is_dir($dir)) { $directory = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); //iterate through each file in this directory foreach ($directory as $path ) { set_time_limit(30);//we try to avoid timing out //Remove and delete invalid file types $validImagesExts = array('jpg', 'png', 'gif', 'jpeg'); if($path->isFile() && !in_array($path->getExtension(), $validImagesExts)) { unlink($path);//we delete the invalid file continue; } //if valid image file we save it to the page if($path->isFile()) { $p->of(false);//output formatting off $p->images_field->add($dir . '/' . $path->getFilename()); $p->save(); } }//end foreach $p->of(true);//output formatting on }//end if (is_dir($dir))) else echo 'No Such Directory Found!';
  15. Off to the pub we go for now...
  16. This folder is full of examples /wire/modules/Fieldtype/
  17. Changwuf31, welcome to PW and the forums. PW does not output any markup. If you know your CSS and HTML, you can easily create a responsive, etc site. PW does not get in your way. To get most of the system, I suggest you start with these tutorials: http://processwire.com/docs/tutorials/simple-website-tutorials/
  18. @Peter Btw, if all you are using the field 'Content_Type' for is to differentiate those Blog Posts from other Posts, remember you can also use a checkbox. A checked checkbox could denote 'special' posts. Alternatively, if you still want to use the page field 'Content_Type', unless there are other special tags, there is no need for that field to be a Multiple Page field. There are a number of options. One that would work right across the board (but may not be easy/possible for your editors?) is, instead of adding the extra 'Content_Type' field, just set the page status of your 'special' Posts to 'hidden'. They won't show up in Posts, Tags, Categories, Archives and Authors pages. For Comments and Recent Comments and also to show them in your stand-alone section of the site you would need to do something like below... Show only special posts in stand-alone section //find only hidden posts //$posts = $pages->find("template=blog-post, status>1024");//similar to below but less readable $posts = $pages->find("template=blog-post, status>".Page::statusHidden); echo $modules->get('MarkupBlog')->renderPosts($posts); Remove hidden (special) posts from the output from the demo blog-comments.php, i.e. /blog/comments/ //modified code excerpt. See the file blog-comments.php $comments = $blog->findRecentComments($limit, $start); foreach($comments as $comment) { //remove comments from blog posts with hidden status if($comment->page->isHidden()) $comments->remove($comment); } $content .= $page->blog_body . $blog->renderComments($comments, $limit); Remove special posts from the Recent Comments in the right sidebar of the demo blog (blog-side-bar.inc) //excerpted and modified from blog-side-bar.inc foreach($comments as $comment) { if($comment->page->isHidden()) continue;//ignore comments from hidden posts $cite = htmlentities($comment->cite, ENT_QUOTES, "UTF-8"); $date = $blog->formatDate($comment->created); $out .= "<li><span class='date'>$date</span><br />" . "<a href='{$comment->page->url}#comment{$comment->id}'>$cite » {$comment->page->title}</a>" . "</li>"; }
  19. Related issues: https://processwire.com/talk/topic/4222-custom-field-to-select-unpublished-pages-selectable-but-doesnt-save-selection/ https://processwire.com/talk/topic/5083-possible-bug-page-fieldtype-with-custom-selector-to-find-selectable-pages-returns-error-while-saving-page/ From that last link, it says that you would have to use ID instead...('template=user, roles=1234')...See Ryan's explanation...
  20. Have you seen this?: https://processwire.com/talk/topic/4131-difference-between-add-and-append/ - with the exact same topic title as yours... I also recall you've asked a similar question today here? https://processwire.com/talk/topic/6662-markup-cache-and-pw-performance/?p=81253 No need to double post..
  21. Nice one Adrian! Minor suggestion, maybe add a note/description to the setting 'Protect children' that the protection cascades to grandchildren, etc.
  22. Since you've isolated the problem to pages that contain repeater fields, that's where I'd focus (having ruled out the other usual suspects). Have you tested your site on a local/dev server? Do you get the same problems? Maybe its some field within the repeater? You could remove them one by one from the repeater and see if that changes things? Using massive images in the single image field? Just a couple of things to check out... Are there any errors recorded in your PW logs btw?
  23. OK. If you have any issues with the Blog Module please post them in its support forum, thanks.
  24. Hi @Sephiroth, Welcome to PW and the forums. I am sure Joss is writing a long post right now to answer your questions ...(edit: he just did) About this: Can you confirm if you are really talking about the Blog (Site) Profile rather than the Blog Module? if the latter, what errors did you get? The Blog Module works fine for me even in 2.5.9. PHP Unit Testing: There was something in the works but I don't know the current status - https://processwire.com/talk/topic/2609-tests-for-processwire-core/ Menu Management: There is nothing out-of-the-box that the client themselves can (should?) use. A while back I did a proof-of-concept Menu Builder but never got it finished. However, there are other ways to achieve this. One way is to set up (yes, you guessed it), a 'page' field that you can attach to some template where a client can select pages that he/she wants to appear in a menu. A second similar option is to set up a 'checkbox field' that you attach to the template of pages that can potentially appear in a menu. Every time the client edits such pages they can tick the checkbox to enable (or disable depending on how you code it in your template file) that page to appear (or not appear) in a menu. Custom Post: Don't use WP so I don't know what this is. Maybe explain a bit more? Edit: OK, just read this: Given Joss' explanation above about pages, I think that answers your question. Really, in PW everything is custom. PW doesn't care what you call them . You will probably get a better explanation...
×
×
  • Create New...