Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Hi @MarcV and welcome to the forums! A few comments. It's not a good idea to overwrite the $page variable because then the current page will refer to the page with ID#1004. Most of us use $p when referencing another page. You are not saving the page, so the changes are not sticking, but then you probably don't want them to stick because then they would affect all users. Can't you simply add a conditional at the top of template file for page#1004 that says to throw a 404 (throw new Wire404Exception();) if the page id is 1004 and the user's hostname is xxxxx? Does that help?
  2. Thanks for the thoughts Raymond! Are you are talking about dummy pages that are not actually in the database, but are only rendered on the front-end? That sounds intriguing to me, and I think might be a cool addition to this module - will have to think more about how best to implement. Or, are you talking about adding real pages? I think it might be confusing the role of this module to get into generating pages. I think perhaps what I would recommend is using the "Add" mode of BatchChildEditor to create the pages, then if you have AutoContent installed, the dummy content will be added when the pages are rendered. I could potentially add an "Auto Add" mode to BatchChildEditor which created the x number of pages with random names to make this even quicker. The other reason I wouldn't want to add pages with AutoContent is the subsequent need to delete once you no longer need the dummy pages. BatchChildEditor makes this quick and easy.
  3. @ZGD - you are not the first to report this: https://processwire.com/talk/topic/6102-batch-child-editor/?p=97690 I have my PHP settings (memory, execution time, etc) high enough that I haven't seen this, so the quick fix is to make those adjustments at your end. I do however have it on my list to modify the export script so it works in batches so this won't be necessary - thanks for the reminder!
  4. Thanks for that - should come in very handy, especially for the address components of the MapMarker fieldtype.
  5. Not sure your exact needs, but this module might also be of use: http://modules.processwire.com/modules/fieldtype-select-ext-option/ - it allows you to generate a dropdown/radio/checkboxes etc from an external database table.
  6. Hi everyone, This is an early (but mostly functional) version of a module that I am experimenting with for automatically populating all empty fields on a page. It is designed for use during site development and should be uninstalled once the site is live. https://github.com/adrianbj/AutoContent (anyone have an idea for a better name?) It currently supports the following field types: Text - outputs "This is an example Field Label", where "Field Label" is the label for the field Textarea (RTE and plain) - configurable content from http://loripsum.net/ and embedded images from http://lorempixel.com Datetime - honors output formatting and returns random date/time with configurable min/max datetime Integer - honors min and max settings Float - honors min, max, precision settings URL - returns a random URL Email - returns a random email address Image - you can specify image category (people, nature, business, etc), and the range for min/max number of images to generate. Page - creates runtime selected child page content for output - not well tested yet. MapMarker - not well tested yet! I will be adding support for Profields and other selected 3rd party fieldtypes shortly. Highly configurable content is provided by: http://loripsum.net/ http://lorempixel.com/ https://github.com/fzaninotto/Faker Generated content can be localized to your region - very handy for addresses, people's names, phone numbers etc: Many fieldtypes are configurable via the Input tab on the field's config settings, eg: Textarea: Text: Images: Datetime: In general I am designing this to work with minimal/no configuration so you can install and have all fields on all pages on your site immediately populated for testing layout and styling without the need for manually adding dummy content. There is also a dummy page batch creator and deletor (automatically tracks and deletes just the dummy pages) available from the module config settings page. Please let me know if you think you will find this useful - trying to get an idea of how much time to put into support for additional field types.
  7. Thanks horst - I am interested in putting some time into this - will have to see how my commitments pan out. I do think I could make significant use of it though, so maybe can justify it sooner than later. One additional idea would be to allow for injecting "ng-attr-fill" into the svg code for styling with angularjs expressions - I know, getting a little carried away
  8. Another idea - what about storing the icon code in the db? You could maybe even have a module config tool for adding new icons - an upload field that takes the SVG from the uploaded file, and encodes it so it's ready for storage and usage in the module? Or maybe write the encoded content back to the file in the filesystem?
  9. Looks awesome horst! What do you think about maybe defining the icons in a different file? Either for all the icons, or an optional, additional file that each developer can maintain for their own icons? I actually think two separate files might be nice - one in your module's directory so that we can easily contribute new icons via PRs, and the another one that sits under /assets/svg-icons/ that we can maintain ourselves.
  10. If you want to stick with a password field you can do this: if($page->password->matches($input->post->pass)){
  11. It looks like you are just wanting to require just a password, and not a username as well? And it looks like there is only one valid password per page? If so, then just use a text field so you can match them directly (since a text field won't be encrypted). Alternatively, you could use: https://processwire.com/talk/topic/8387-page-protector/ - you'll likely want to use the Login Template option. This will require a username and password, so it may be more than you need.
  12. I haven't investigated very far, but I am seeing an array vs string error due to: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/PageFinder.php#L1182 There is a note in that file that I think might be related: // TODO Make native fields and path/url multi-field and multi-value aware So it is possible that support is planned but hasn't been implemented yet.
  13. This should do the trick: $pages->find("(path=/news/),(path=/about/)"); And here is some more info on "OR group" selectors: https://processwire.com/talk/topic/3768-processwire-dev-branch/?p=64049 Or, depending on your needs, you could maybe match by name rather than path: $pages->find("name=news|about"); Of course there is the chance that another page with name "news" or "about" may get created elsewhere in the page tree, so you could help mitigate this by supplying a parent of home as well: $pages->find("parent=/, name=news|about"); I am curious though what is wrong with using the ID - seems like it might be the safest option? Just be sure to add a comment above the selector so you know what they are referring to.
  14. It was first base Ryan, second base Ryan, third base Ryan ...
  15. @felix and everyone I have made some initial adjustments to make this module more versatile. It now has two config fields for setting up the JS video player of your choice and the player template code. By default it comes configured to use MediaElementJS, but you can easily change to VideoJS, JW Player, Plyr.io or whatever you prefer. Once configured all you need to do is: echo $page->video->play; With the default setup, you only need to upload an MP4 and it will work on all browsers/devices. I might potentially make it possible to also upload a WebM version so that you can play with HTML5 in all browsers/devices without the need for a fallback flash player on FF/Chrome, but I'll see if people really have a need for this. I would still like to make several refinements, but if anyone tests this version, please let me know how it goes.
  16. Hi Zahari, This module should be getting a facelift soon - I'll be getting rid of the Sublime player and setting up mediaelementjs by default, but also making it very easy to switch to VideoJS, Plyr, JW Player - whatever you want really. I haven't installed ffmpeg-php on a Mac - only on my Linux box, but do these instructions help: https://www.drupal.org/node/1464236
  17. Actually, it does extend Inputfield: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module#L15 but since you are using it from a different module it doesn't know to autoload these because they are not in the same folder as your new module. I think you might need to share the code for your new module so we can see where things might be going wrong.
  18. I did a couple of WP sites back in the day and this was my experience - except that I found it was never a perfect fit, so it was never great I think if you are happy quoting a budget price and saying no to those little changes then you can get by with WP, but I am always embarrassed to say I can't make a change that the client wants and when WP makes these changes so hard, I just don't think it is worth it. I actually find development of even simple sites easier and quicker with PW.
  19. Often you just need to do this: public function init() { parent::init(); } The parent::init() is the trick. Here is a comprehensive discussion on it: https://processwire.com/talk/topic/1416-inputfieldmodule-doesnt-autoload-their-jscss/
  20. Those php notices shouldn't prevent the module from working. Admittedly they should be fixed, but are you sure that the module is no longer working? If you disable debug mode you shouldn't see the errors.
  21. Is InputfieldPageAutocomplete.min.js getting loaded? Are you seeing an AJAX request (via the console Network tab)? Are there any errors?
  22. A couple of options: 1. You can use the Template Access tab to disallow view access to guests and determine what they will see instead. 2. Use this module: http://modules.processwire.com/modules/page-protector/ to limit access to specific pages only to logged in users, and prompt them to login if they aren't already. Hope that helps
  23. Hi @roblgs and welcome to PW and the forums. Did you also install the MarkupBlog module? MarkupBlog is not necessary if you want to create your own posts.php and post.php template files, but it makes it much quicker and easier to get going and you can use those files as a starting point and style from there.
  24. Hi Felix, This sounds like a great idea - I am pretty limited on time at the moment, so a PR would be awesome. I am thinking that it shouldn't be too hard to put together by borrowing from Ryan's PWImage button and maybe looking at how teppo added a new button to CKEditor with his Hanna Code Helper: http://modules.processwire.com/modules/hanna-code-helper/ Perhaps with the time I have available I should sort out removing of sublime video (since they are now dead). As a replacement I would like to make it possible to link to your preferred player (via a provided CDN link) and then provide the required code for playing, eg if you like using mediaelementjs, you'd define like this: <video src='{url}' poster='{poster}' width='720' height='408' ><track kind='subtitles' src='{subtitles}' srclang='en' /></video> Your embed button would make use of these two config settings: 1. CDN Link, 2. Play code (replacing the {} parts with the correct values from the selected video. It would be great to add these features and actually release this module in the PW modules directory. What do you think?
  25. Sounds good - please follow up with me when he is back - hopefully I can reproduce the issues you are having.
×
×
  • Create New...