Jump to content

Robin S

Members
  • Posts

    4,928
  • Joined

  • Days Won

    321

Everything posted by Robin S

  1. Not sure why it wouldn't work in your case, but try getting the page by ID instead: $p = $pages->get(1234); This may be something that has changed in PW3, because I found this old post from Soma that suggests you need to add 'include=all' when getting a page by path:
  2. I can get an unpublished page okay with: $p = $pages->get('/path/to/page/'); Are you sure your path/name is correct?
  3. @Michael van Laar, you could use a hook to set the value of the Page field after a new article page is added. In /site/ready.php: $this->pages->addHookAfter('added', function($event) { $page = $event->arguments('page'); if($page->template->name != 'article') return; // your logic here to find the right author ID $page->setAndSave('author', $my_author_id); });
  4. To avoid editing core admin themes you could use the Admin Custom Files module and append to the document title with jQuery: $(document).prop('title', $(document).prop('title') + ' • ProcessWire');
  5. @majake I did a bit of sleuthing and I think your website may be using the Spex module. http://modules.processwire.com/modules/spex/ I don't think this module is very widely used (it doesn't come up often in the forum) so there may not be many members here who can help you with it. But check out the links above and that may point you in the right direction. One more thing - your site seems to already have an RSS feed with the same content you are trying to output: http://www.roofcoonline.com/blog/rss
  6. @majake - I suggest you remove the config info in your previous post for the sake of security. You don't want to be posting your DB username/pass etc in a public forum. A couple of other ways that "main.php" might be appended: 1. The file is pulled in with an include in your RSS template. Probably not as I expect you would have noticed this. 2. It would be unusual, but I suppose the file could be appended in a hook. So you could try this: In your RSS template, insert this: <?php $no_main = true; ?> And at the first line of "main.php" (or whatever the file is called that contains your header/footer markup): <?php if(isset($no_main) && $no_main) return; ?> Edit: actually, could you post the contents of your RSS template file? That will help get to the bottom of the problem.
  7. Hi @majake and welcome to the PW forums. I haven't used this module before, but I think you're right about the problem being related to a "delayed output" strategy. There is probably a template file being auto-appended to your RSS template - typically this would be called "main.php", "main.inc" or something similar. The instruction to auto-append this template file will be in your site config: probably in the /site/config.php file unless your site is using the ProcessWire Config module that stores additional config settings in separate JSON file. If there is a template file being auto-appended you should see a checkbox to disable this for the RSS template: Setup > Templates > rss (or whatever your template is called) > Files tab
  8. Thanks for the confirmation @Zeka. I have created a Github issue and suggested your fix. The problem can be worked around for now using the size() method with cropping set to false. $my_image->size(400,400, array('cropping' => false)); @horst, the weighten feature in PIA is cool.
  9. In the blog post that introduces the $pageimage->maxSize() method, it is described like this: But when I use maxSize() in PW 3.0.37 I do get a cropped image. I have an image that is 1200x600 and if I do $my_image->maxSize(400,400)->url I get an image that is cropped 400x400 when I think it should be uncropped 400x200. Can anyone confirm? I'm sure this method used to work properly as described.
  10. You nearly had it $results = $pages->find("template=name-of-child-template, sort=parent.field-on-parent-template");
  11. A bit off-topic, but have you considered any alternative ways of displaying documentation other than the approach your taking? For instance, it seems like it would be a lot simpler if your documentation pages were displayed on the front-end. What I do for client documentation is this: 1. Create a documentation template. Don't give users edit access to pages using this template. 2. In the template file, perform a check that the user is logged in with the appropriate role, otherwise throw a 404. 3. Create documentation page(s) via the PW admin. I just use a single long page with a table of contents and anchor links but multiple pages would work equally well. 4. Insert links to the documentation page(s) into the admin theme for easy user access. I do this using jQuery via AdminCustomFiles because it's dead simple, but I think a hook would work too.
  12. I tested your issue in PW 2.7.2 and I can't reproduce it. Toggling back and forth between a default view of Rows and Grid updates as expected when the field is inside a repeater. You could consider upgrading to PW3 where images may be deleted from all thumbnail views. Or if you must stay with PW 2.7.2 you could try this module from @BitPoet.
  13. I don't think that's going to work. For starters, you can't use the "Custom PHP" option with Autocomplete. See the field description: Also, the type of dependent select you need only works for select inputfields. You could try having the second Page field use a select inputfield and use this as the "Custom selector": template=committee_event, committee_draft=page.committee_draft, include=all Not sure if dependent selects work with the first inputfield being anything other than a select, but it's worth a try. Edit: it doesn't work - both fields using this type of dependency must use a Select, Select Multiple or AsmSelect.
  14. Besides Repeater and PageTable, there are Table and Multiplier in the ProFields package that can be used for repeating content. But for a simple repeatable text string you could just use a textarea field and explode() on newline to get an array of values. $values = explode("\n", str_replace("\r", '', $page->my_textarea));
  15. If $config->domain is staging.domain.com (it already includes a subdomain) then that makes your httpHosts array resolve as: staging.domain.com, www.staging.domain.com, assets0.staging.domain.com, assets1.staging.domain.com, assets2.staging.domain.com, assets3.staging.domain.com So instead you probably want something like: $config->domain = 'domain.com'; $config->httpHosts = [ $config->domain, "staging.$config->domain", "www.$config->domain", "assets0.$config->domain", "assets1.$config->domain", "assets2.$config->domain", "assets3.$config->domain" ];
  16. Front-end editing works okay for me when using $page->render(). If you are using "Option A" for front-end editing make sure you have selected "Fields editable regardless of page". But a couple of observations: 1. Do you really need to be rendering pages? Can you not just get your pages into a PageArray and iterate over them, echoing the fields you want? $items = $pages->find("template=my_template"); foreach($items as $item) { echo "<h3>$item->title</h3>"; echo $item->body; // etc } If you're sure you need to render you might be better off using $files->render() as it is better documented than $page->render(). 2. In your code... ...you are overwriting the core API $modules variable. You should choose a different name for your variable.
  17. Hi @adrian - with the change, the editor paths are working properly for me in all of these places.
  18. Can you incorporate the logic into "Custom PHP code to find selectable pages"?
  19. The ImportPagesCSV module does not include a permission in the getModuleInfo() method, so you would need to edit the module file to add one. Bear in mind that this would be overwritten if you later update the module. public static function getModuleInfo() { return array( 'title' => 'Import Pages from CSV', 'version' => 106, 'summary' => 'Import CSV files to create ProcessWire pages.', 'singular' => true, 'autoload' => false, 'permission' => 'import-csv', ); } Refresh the module cache, create custom permission 'import-csv' and give that permission to any role that is allowed to use the module.
  20. This thread may be related: Try clearing the module cache and see if that fixes your issue.
  21. I can confirm. Looking at the Pages table in the DB there are no Home page children with sort values of 0, 1 or 2. Maybe raise a GitHub issue for this? It does. From the API reference... $page->sort int Sort order of this page relative to siblings (applicable when manual sorting is used).
  22. You could try adding some padding to the bottom of the Form Builder iframe to allow for the height of the datepicker: #FormBuilderViewport_myformname { padding-bottom:200px; }
  23. I haven't tried it, but there is this: https://github.com/Reinmar/ckeditor-plugin-descriptionlist
  24. @szabesz: I updated the code examples.
  25. Happy to do that. I'm just about to head away for a few days but will go through systematically when I'm back.
×
×
  • Create New...