Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/26/2020 in all areas

  1. Alpine.js & Vue.js & Tabulator but it would also be a use case for any other JSON powered solution out there, of course.
    3 points
  2. Firstly, are you sure you need to modify the module for "style editing"? In case you haven't read already: https://processwire.com/docs/modules/guides/comments/ Secondly, if you do find you need to modify, I would consider upgrading to the very latest dev as there have been some major changes to the comments field and an important bug fix. Consider those before worrying about why the approach you are taking isn't working yet.
    2 points
  3. Hey @Pip, you're on the right way - keep on going... I would do it this way: Create a template for the items Create a template for the ingredients Create a page for holding all ingredients I normally use an empty template called "placeholder" for these pages Create a "Page Reference Field" called ingredients and assign this field to the items template Make sure to use "Choose multiple" in "Input" tab It's on your side to choose which one works best for you - just play around Choose the parent page "ingredients" as parent - see 3.) You can check "Allow Creating new Pages" - this gives you the option to add new ingredients directly from the item page. Now every thing should be set up to create a new "item" page. You should be able to select or create new ingredients directly from this page. Your page tree should look like this in the end: - Items - Pizza Dough - Hawaiian Pizza - Ingredients - Sauce - Pineapple - Cheese - Ham Even if this video is a little bit old, here's Ryan showing how it works:
    2 points
  4. Hi everyone, This new video fieldtype extends FieldtypeFile. Video is available via: $page->video_field->url Module automatically creates a poster image of the video on upload and makes this available via: $page->video_field->poster Shows the duration of the video on the title bar, next to the filesize Stores SRT files for subtitles accessed via: $page->video_field->subtitles Formats a transcript from the subtitles, accessed via: $page->video_field->transcript I am using mediaelementjs to display the videos, so editing users can easily upload videos and enter SRT files. The following code is used in the template file. You can adjust this if you'd prefer using VideoJS or some other HTML5 player. <video src='{$page->video_field->eq(1)->url}' poster='{$page->video_field->eq(1)->poster}' width='720' height='408' ><track kind='subtitles' src='{$page->video_field->eq(1)->subtitles}' srclang='en' /></video> Additional Settings You can additionally set a few different options in the field's Input tab: Number of poster images to generate - if you change from the default of 1, the editing user will be able to select which image they want to use for the poster image Copy poster image to dedicated image field - not necessary but gives you more options of interacting with the poster image(s) Field that you want poster images copied into - only relevant if the option above is checked Try it out (NB: the code is rough - it works, but needs cleaning up. Github: https://github.com/adrianbj/FieldtypeVideo NB: Requirements The module requires ffmpeg and ffmpeg-php, although I can make the latter optional fairly easily. I don't have any requirement checking implemented yet, so if you don't have these, you'll get php errors. Possible future enhancements Ability to specify what frame is used for the poster - either by number, and/or by offering several options to choose from Done! Push poster image to a dedicated image field Done, although could be improved Field for pasting in or uploading closed captions Done, but need to look into multi-language options etc Support for uploading multiple formats of the same video (mp4, webm, etc) and/or automated video format conversion Integrate mediaelementjs into the module so users can enter shortcodes in RTE fields to display videos where they want My biggest concern, is how useful this will be to people - how many hosts actually have ffmpeg setup? Do any have ffmpeg-php? Anyone have any ideas for features they'd like to see?
    1 point
  5. This module allows you and your site editors to protect a page (and optionally its children, grandchildren etc) from guest access directly from the page's Settings tab. You can also limit access to certain roles. http://modules.processwire.com/modules/page-protector/ https://github.com/adrianbj/PageProtector It makes it very easy for editors to set up various password protected areas on their site, or to simply protect a new page or section while they are still working on it. Ability for your site editors to control the user access to pages directly from Settings tab of each page Include whether to protect all children of this page or not Optionally allow access to only specified roles Option to protect all hidden pages (and optionally their children) Ability to change the message on the login page to make it specific to this page Option to have login form and prohibited message injected into a custom template Access to the "Protect this Page" settings panel is controlled by the "page-edit-protected" permission Table in the module config settings that lists the details all of the protected pages Shortcut to protect entire site with one click In addition to the admin interface, you can also set protection settings via the API: // all optional, except "page_protected", which must be set to true/false // if setting it to false, the other options are not relevant $options = array( "page_protected" => true, "children_protected" => true, "allowed_roles" => array("role1", "role2"), "message_override" => "My custom login message", "prohibited_message" => "My custom prohibited access message" ); $page->protect($options); As alway, I would love any feedback / suggestions for improvements. Hope you find it useful! Page Protection Settings (settings tab for each page) Module Config Settings
    1 point
  6. Cacheable Placeholders This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there. Consider this simple example, where you want to output a custom greeting to the current user: <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale. This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this: <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook: // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github! Features A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links Github Repository & documentation Module directory If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    1 point
  7. Just an FYI for anyone who reads this - this is deprecated since MySQL 8: https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows I have told Ryan here: https://github.com/processwire/processwire-issues/issues/1146#issuecomment-629428382
    1 point
  8. You might can explain what you are trying to achieve ? Maybe it's copying/editing the module is not required ?
    1 point
  9. There's at the moment no concept of pagination in RockFinder3, because it was initially built to build the data array for client side datatables that do the pagination and sorting on the client side. Could you please explain your use case a little more? Why is a regular $pages->find() no option if you get the data paginated anyhow?
    1 point
  10. That's sort of a loaded question but given the writing on the wall, I would go with Flutter. There's articles out there comparing the two if you want to get into specifics.
    1 point
  11. Bingo! From the looks of it, this was the setup: There was a field of type Checkbox with the name footerlink. This was assigned to a template (or even templates). When editing a page with that template, if you wanted that page to appear in the footer menu/nav as a link, you had to tick the checkbox. ProcessWire stores a ticked checkbox as 1 in the database. The code in footer.inc would look for all pages that had their checkboxes ticked (this is the $pages->find("footerlink=1"). It would then output them in the footer menu/nav. Since you have no footerlink field, ProcessWire throws the error. For non-superusers, we are not shown the real error, so we get a generic 500 error. Quick remedy Create a field of type Checkbox and name it footerlink. Add it to the template(s) whose pages you'd like to appear in the footer menu/nav (@note: editors should be instructed not to tick too many pages' checkboxes, otherwise it could break the design, but this is up to you. You might even want (as the developer) to take control of this). Change the code in footer.inc as below: <div class="row"> <div class="col-md-12"> <ul class="nav navbar-nav footer-nav"> <?php // nav based on checkbox field $footerNavItems = $pages->find('footerlink=1'); if($footerNavItems->count) { foreach($footerNavItems as $item) { echo "<li><a href='$item->url'>$item->title</a></li> "; } } if($user->isLoggedin()) { // if user is logged in, show a logout link echo "<li><a href='{$config->urls->admin}login/logout/'>Logout ($user->name)</a></li>"; } else { // if user not logged in, show a login link echo "<li><a href='{$config->urls->admin}'>Admin Login</a></li>"; } ?> </ul> <div class="footer-copyright">&copy; 2020 ViveSport</div> </div> </div> Some things to Note Some people don't like exposing the link to the admin of their ProcessWire sites in cases where they have changed the name of the admin login from the default one (ie. processwire). If that's the case, remove the logged in user code. I know you were debugging and it has helped us, but live sites should not have their config->debug set to true. An easier way would have been to debug whilst logged in as superuser. A better way is to install the module TracyDebugger. Hope this helps.
    1 point
  12. I suggest you check this website that Ryan created to show the potential of PW, you can see the Frontend, the Backend and the source code on Github: https://processwire.com/about/demo/
    1 point
  13. Awesome module @bernhard, adding it to my default installation profile.
    1 point
  14. Developing custom fields for ProcessWire is great! And it's easier than many might think once you get the basic concepts. But it's hard to learn those concepts by reading the code and doing some trial and error... That's why I think we need a good tutorial about that topic. It took me quite long, but now I feel knowledgeable enough to write such a tutorial. I also have the idea (or the need) for some new fields that might be helpful to the community. What I don't have is time ? So I thought to share the workload and share my knowledge while the development of the module (and testing, writing docs, etc) could be done by someone else under my supervision (hope that does not sound scary ? ). What do you think? I'm happy to hear your opinions - we are in the PUB ? Have a great week and happy coding!
    1 point
  15. Would be interesting to hear about your use case where you'd need such an API ?
    1 point
  16. I believe what was meant was piece of cake for ProcessWire, i.e. ProcessWire can handle it ? (in. reference to your "Hope do not regret this"). Welcome to the forums and ProcessWire ?
    1 point
  17. Hi @tomasanjosbarao I'm not sure if this would help or make things more complicated ? The goals is anyhow that everybody can in the end learn by reading (and maybe watching) the tutorial ?
    1 point
  18. Can I still join, @bernhard? I'd really like to learn this. Thanks!
    1 point
  19. You won't regret it!
    1 point
  20. All good now. Second installation process was successfully. Now I'm ready for testing. I want to create a directory site for local artisans. And after viewing and testing some other CMS I came to the conclusion that processwire will be the first choice and I think it's highly qualified for this case. Hope do not regret this.
    1 point
  21. I would probably prefer to put my users under the Members page directly. That way you would still end up with your suggested page tree, but those pages would actually be the users and there would be no need to maintain a relationship between users and their pages. Have a look at this blog post for a tutorial: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users
    1 point
  22. @ryan Thank you for your insight, it was an interesting read to learn more about your current refactoring efforts. I am wondering if it is the right time for you to also start working on the Javascript API perhaps? I don't remember since when it is on the roadmap, but in this post from 2017 you wrote: "...so I'm going to continue to keep this in our roadmap."
    1 point
  23. v1.0.3 adds two new features: addPath() each() Callbacks RockFinder3 supports row callbacks that are executed on each row of the result. Usage is simple: each() $RockFinder3 ->find("template=cat") ->addColumns(['title', 'weight']) ->each(function($row) { $row->myTitle = "{$row->title} ({$row->weight} kg)"; }) ->dump(); These callbacks can be a great option, but keep in mind that they can also be very resource intensive! That applies even more when you request page objects from within your callback (meaning there will be no benefit at all in using RockFinder compared to a regular $pages->find() call). addPath() A special implementation of the each() method is the addPath() method that will add a path column to your result showing the path of every page. This will not load all pages into memory though, because it uses the $pages->getPath() method internally. $RockFinder3 ->find("template=cat") ->addColumns(['title', 'weight']) ->addPath("de") ->dump(); If you need the path for linking/redirecting from your data to the pages it might be better to build a custom redirect page that works with the page id, so you don't need the overhead of getting all page paths: <a href='/your/redirect/url/?id=123'>Open Page 123</a> If you really need to access page objects you can get them via the $finder parameter of the callback: $finder->each(function($row, $finder) { $row->foo = $finder->pages->get($row->id)->foo; }
    1 point
  24. @picarica all good, glad you solved it and no need to apologise ?
    1 point
  25. What @Ivan Gretsky said in his second paragraph. You will want to build your backend (ProcessWire) with a RestAPI, catching/storing media from Internet on the server and delivering content/data/media to your mobile apps (hybrid, native, whatever). The apps will fetch the data from there periodically and save theses data on the local Internal/External storage of the user device. I personally use heavily SQLite as storage with my mobile apps. For the Youtube video, you can build something customized. You will not get stats about the viewers on Youtube but the end-user will have access to the media once synchronized. The idea is the following. When you upload a video on Youtube, you then fetch the video from the backend and save it on the server. Then when the app will synchronize the data, it will get and store the media on the device which will be played offline inside your app with the media player of the framework used. If the idea of catching, converting and storing the media directly from Youtube is against any Terms of Services, you could build and upload manually a compressed version of the media on the server. The goal is to have the media on the server whatever the method used... And anyway, the user will have to manage to get an access Internet from time to time to be able to download/update the app from the store or to synch the data from the backend. Also, shipping the media directly in the app (when downloaded from the app store) is a bad idea. You will ran into the issue where your binaries are limited in SIZE. Example, https://help.apple.com/app-store-connect/#/dev611e0a21f About the app development, I think you should start with an hybrid one, it will be a good first experience and will be "quite easy" to build as the learning curve will be low and, you have already the competence required for it (HTML5, JAVASCRIPT, CSS). You will have to "just" learn how to put it in a native container.
    1 point
  26. @kongondo Have been studying/playing with Flutter and catching up on latest trends in CSS, Photoshop, and other stuff during "all this sh*t" (that's what we in Australia call the pandemic that will never be named). Can't "asynch await" to put new knowledge into action ?
    1 point
  27. omg thank you so much i was so stupid ? i changed it to this and it work foreach ($page->produkt_repeat_field as $building) { foreach ($building->r_galeria_image as $obrazok){ $thumbnail = $obrazok->size(450, 250); echo"<article>"; echo "<a href='{$obrazok->url}' class='fresco' data-fresco-caption='{$obrazok->description}' data-fresco-group-options='preload: [1,2], effects: {spinner: {show:150, hide:150 } }' data-fresco-group='kolace'><img src='$thumbnail->url' alt='obrazok'></a>"; echo"</article>"; } } i totally forgot i was looping throught repeat fields and not throught gallery, thank you sorry for my mistake
    1 point
  28. Good day! One way could be to include all videos in the mobile app installation package, so all the content is downloaded when the app is installed. I am not sure it is possible, or if there is a restriction on what you can put in the installation package and the size of the app, if distributed with the official stores. But that would be not a PWA thing, but rather a native app. The other would be to allow to download (cache) just the videos you need from the list in the app. So you install the app and then download the ones you need, while still "have the Internet". This should be available in PWAs as well as in native apps. But anyway, there must be problems with caching Youtube videos you're using. I would expect problems caching those.
    1 point
  29. Thx for the interest everybody! I'm in contact with @elabx and @Sephiroth and we will try to build something useful and document the process so that everybody can learn from it. Similar to what ryan planned with the events fieldtype, but step by step, so it's easier to follow ?
    1 point
  30. Here's some discussions/showcases on Progressive Web Apps. The first one is particularly helpful. An alternative you could consider, if you have the time and want to pick up a new skill is to create your android app using Flutter ?
    1 point
  31. You are looping through the repeater field items (buildings) but not their images (one or many per building) as well. By default an 'images' field can hold multiple images and you simply loop through them. If the only field in your repeater is 'r_galeria_image' then it's unnecessary to have a repeater. foreach ($page->r_galeria_image as $image) { $thumbnail = $image->size(450, 250); echo"<article>"; echo "<a href='{$image->url}' class='fresco' data-fresco-caption='{$image->description}' data-fresco-group-options='preload: [1,2], effects: {spinner: {show:150, hide:150 } }' data-fresco-group='kolace'><img src='$thumbnail->url' alt='obrazok'></a>"; echo"</article>"; }
    1 point
  32. Displays image tags overlaid on the thumbnail using customisable colours. This makes it easier to see which images have which tags without needing to open the edit pane for individual images or changing to the list view. Screenshot Usage Enable tags for one or more image fields. Install the Image Thumbnail Tags module. Optionally configure colours for any of your tags. https://github.com/Toutouwai/ImageThumbnailTags https://modules.processwire.com/modules/image-thumbnail-tags/
    1 point
  33. Hi, just a hint: I do not yet have much experience in this but for a similar (but not exactly same) use case I use @adrian's PageProtector module which supports locking down all Unpublished and/or Hidden pages just by clicking two checkboxes. I use it to protect areas of the website which are not yet ready to be seen by the public. Of course in my case Published pages should be accessible by guests, but you might want to take a look at the module's code to see how he did it so that you can extend it to Published pages as well:
    1 point
×
×
  • Create New...