Jump to content

Robin S

Members
  • Posts

    4,800
  • Joined

  • Days Won

    304

Everything posted by Robin S

  1. @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.
  2. 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
  3. 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.
  4. 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.
  5. You nearly had it $results = $pages->find("template=name-of-child-template, sort=parent.field-on-parent-template");
  6. 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.
  7. 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.
  8. 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.
  9. 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));
  10. 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" ];
  11. 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.
  12. Hi @adrian - with the change, the editor paths are working properly for me in all of these places.
  13. Can you incorporate the logic into "Custom PHP code to find selectable pages"?
  14. 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.
  15. This thread may be related: Try clearing the module cache and see if that fixes your issue.
  16. 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).
  17. 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; }
  18. I haven't tried it, but there is this: https://github.com/Reinmar/ckeditor-plugin-descriptionlist
  19. @szabesz: I updated the code examples.
  20. Happy to do that. I'm just about to head away for a few days but will go through systematically when I'm back.
  21. If you removed /site/config.php that will definitely cause a problem. No need to touch that file when upgrading.
  22. This pretty much works - it just misses out the trailing slash from the original $compilerCachePath so results in a double slash in the link URL. But this could be corrected: $compilerCachePath = realpath($compilerCachePath) . DIRECTORY_SEPARATOR; Alternatively, slash replacement could be done conditional on what the directory separator is (thereby distinguishing Windows from Mac/Linux): if(DIRECTORY_SEPARATOR == '\\') $compilerCachePath = str_replace('/', '\\', $compilerCachePath); Or no conditional needed for this one: $compilerCachePath = str_replace('/', DIRECTORY_SEPARATOR, $compilerCachePath);
  23. Oh right, of course. Yes, that would work. You're right. I'm just being lazy and leaving the file watcher at the default scope, which is all project files. But I could define a custom scope for each project, or use the preset "open files" scope and just be careful not to accidentally open AdminOnSteroids.scss
  24. Thanks, that wouldn't help because the file would still be within the project scope (the whole PW installation is). Somehow AdminOnSteroids.scss would need to be excluded from the module files that are downloaded/installed from GitHub. I'm not very familiar with Git so not sure what options there are for that. Or a different file extension used? I guess that would foul up things at your end. Maybe it has to go into the too-hard basket. I actually only need the SCSS file watcher active while the site is at the static stage, so I probably just need to remember to turn it off afterwards.
  25. @adrian - sorry for the delay. The change you suggested doesn't allow the file compiler path to be successfully replaced. For me the $compilerCachePath variable before the change is... D:/Websites/pw3-testing/site/assets/cache/FileCompiler/ ...and after the change it is... D:/Websites/pw3-testing/site/assets/cache/FileCompiler\ ...but to successfully replace the link to the editor it needs to be... D:\Websites\pw3-testing\site\assets\cache\FileCompiler\ I originally thought my str_replace suggestion was hacky but now I see there is already something similar in the nette/tracy source so maybe it is an okay way to deal with these path issues?
×
×
  • Create New...