Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. That's PHP complaining that you do not have enough memory (you have 32MB). To be honest, I am a bit baffled by this since it is happening on install as opposed to during some image manipulation or similar process when editing a page. Other than increasing the memory size available to PHP, e.g. to 128MB, I am clueless. I'll let others more knowledgeable chime in. Edit: What's your server environment? You can now turn off that debug as well
  2. Hi @Alfonso Rodriguez. Welcome to the forums and ProcessWire. Is this a remote site or on a local install? In your /site/config.php, set the following: $config->debug = true; That will show if there are any errors. Please note that the directive may show some information that is only intended for superusers. So, if you are on a remote/live site, I'd only show that to superusers. If that is your case, let us know so we can show you how to go about it. If you have debug on, do you see any errors? What do they say? Did you see any warnings (red) during the install Process? E.g. ProcessWire complaining about a requirement not being met Is the frontend working? What is your server environment like? PHP and Apache version? or a Windows environment? There's a couple of topics around 'blank' screens but not sure which one applies in your case. Here's a couple: https://processwire.com/docs/install/troubleshooting/
  3. Not repeater specific, and I haven't tested with repeaters, but one option could be the pro module Dynamic Selects.. http://modules.processwire.com/modules/process-dynamic-selects/
  4. What @LostKobrakai said. Here's an example: https://processwire.com/talk/topic/9730-get-pages-used-by-a-pagefield/?do=findComment&comment=97464 Use that in your 'custom PHP' for returning pages for that page field.
  5. Hey @Christoph. There was no inconvenience and no need to apologise . It's just that a properly formulated question not only helps those who can potentially come up with a solution, but also those who might have a similar problem in the future will be able to easily relate. Glad you got it working and thanks for sharing your solution!
  6. Templates need to be coupled to fieldgroups (which need to be created first). I see that your module is an autoload module...was that intentional? Anyway, what the others said. If you need to look at a complete example, here's some code from the Blog module installer.
  7. Sorry, wasn't clear. Where, exactly (file) is the script? Did you create a module? Did you edit a core module? Basically, how are you adding the script to your modal page. Thanks.
  8. Glad you sorted it out. I'm curious though, where/how are you including your script above?
  9. Works as expected for me (gmail, chrome). Just to let you know that Pete is pretty tied up at the moment but he hopes to be back soon to sort out stuff. He is not ignoring these stuff .
  10. Mod Note: Moved this to Off Topic > Dev Talk since not strictly a PW question.
  11. OK. To help other members help you, please: Describe your situation better. Saying you 'experienced the same issue but the other thread had a different topic' is hardly enough to go by. E.g. PW versions, what role(s), etc? Link to the 'other' thread. I had to Google to find it . This is the other thread. Show us some code. What have you attempted so far? Thanks.
  12. So why start a new thread about the same thing ? I'm merging the threads unless I'm missing something?.
  13. I'll have to study this first. It's been a while since I developed the Breadcrumb component of Menu Builder .
  14. Welcome to the forums @Sahil. I have moved your topic to 'General Support'. If however, you are referring to the module Menu Builder, I will move your topic to its support forum and answer you question there. Please confirm.
  15. I get you now, my bad. If you want to avoid reloading the whole page, then the only way to refresh only 1 field is via Ajax. I did something similar on some custom Fieldtype (for a client), although not triggered via a modal. In this case though you will be refreshing a page field..specifically a PageListSelectMultiple. Hmm. Doing it via a modal seems to be the secondary issue here. How to do it in the first place, is the main thing . Maybe if you looked at how that field is normally populated by ProcessWire, that can give you an idea. If you can send JSON (or XML), then it's just an issue of telling jQuery (or raw JS) how to rebuild that PageListSelectMultiple. Maybe I am not thinking this through properly. There could be other ways. I'm having a very slow Monday ..can't think clearly.
  16. Yes it is possible. Example here from the Blog module. Where you put the code, though, depends on your setup. This page being opened via a popup, is that a normal page or some module's page?
  17. ...and we'll be here to help! Please have another go and let us know how it goes .
  18. No need to wait for a day. Go to your module in the repo, click button to edit it and immediately save; (no need to edit anything actually). Voila, it is updated in the repo! .
  19. I already answered how to do this . If you don't want pagination, then, in your case, grab only 1 item. // GET 1 post, SORTED BY created {you could also sort by '-blog_date'} $singlePost = $pages->get('template=blog-post, sort=-created, blog_categories=News'); $out = $blog->renderPosts($singlePost); echo $out; I am not being rude but this is the point at which I encourage you to get that 'PHP for beginners' book (e.g., this one) as well as revisit the PW docs. Let's walk through your code: Line 1#: You grab some posts using find(). That returns a PageArray. You then assign it to the variable $posts. Line #3: You are overwriting the variable $post (which contains the PageArray from Line #1), assigning it an empty string, i.e. ''. Line #4: You are appending to the empty string $post an Object which contains the current page's image. Line # 6: You then append to $post other stuff..... That's why it doesn't work as expected . I am surprised it didn't throw an error. Maybe you have debug turned off?
  20. I have no idea why you have such a setup but anyway, here goes. As per the instructions, your Hook needs to return a PageArray. This is untested: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->name == 'result_judge_challenge') { $page = $event->arguments('page'); $event->return = $page->parent->parent_multi_page_field;// this should return a PageArray } }); You might want to add checks to see if the parent page actually has items in its page field.
  21. I am not sure I understand this one. Not sure if you want 1 post from 1 category or several posts from 1 category. Irrespective, pagination only kicks in when you grab a limited number of items and the results returned are a PageArray. If what you mean is: 1. Render only 1 post from a given category: Here the trick is to return a Page rather than a PageArray. So, we use a get(). findOne() (if you are using PW 3.X) should also work. $content = ''; // render a single blog post on Blog Home Page //$singlePost = $pages->get(11335);// grab by ID $singlePost = $pages->get('template=blog-post, sort=random, blog_categories=News Article, limit=1');// grab a random post $content .= $blog->renderPosts($singlePost); 2. Render several posts from only 1 category. In this case, this will return an array. So, to avoid pagination, we need to grab ALL the available post, i.e. no limit (careful with this one if you have lots of posts!). $content = ''; // render ALL blog posts from a single category on Blog Home Page $oneCategoryPosts = $pages->find('template=blog-post, blog_categories=News Article'); $content .= $blog->renderPosts($oneCategoryPosts); // these will also work; passing in a selector #$selector = "template=blog-post, blog_categories=News Article"; #$content .= $blog->renderPosts($selector); No need to create a different template for blog posts classified as 'News Article'. Instead, we include some extra logic in the template file blog-post.php. See example below. // get the category 'News Article' $newsArticle = $pages->get('template=blog-category, name=news-article'); // special render for blog posts that are classified under 'News Article' if($page->blog_categories->has($newsArticle)) { $options = array('post_categories'=>1, 'post_tags' => 0);// options ONLY for news articles $renderAuthor = '';// don't render blog post author for news articles $renderComments = '';// ditto comments } // normal blog post else { #$options = array();// if you wish, options for all other blog posts go in here $renderAuthor = $blog->postAuthor();// render authors for normal blog posts $renderComments = $blog->renderComments($page->blog_comments);// ditto comments } $content = $blog->renderPosts($page, false, $options) . $renderAuthor . $renderComments . $blog->renderNextPrevPosts($page);
  22. Hmm...what does this mean then? You want to be able to edit these where? In the backend?
  23. Not sure I follow fully, but it looks like you are creating a form builder? You say you want various parts of the form to be editable? If that's the case, I would invest in FormBuilder.
×
×
  • Create New...