Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/30/2017 in all areas

  1. Soundmanager2 Audio for Processwire Github: https://github.com/outflux3/TextformatterSoundmanager Modules Directory: http://modules.processwire.com/modules/textformatter-soundmanager/ This module provides most of the free audio player interfaces for Soundmanager2 by Scott Schiller: Bar UI 360 UI 360+ spectrum UI mp3 buttons mp3 links Page Player, muxtape-style UI Cassette Player The module is a Textformatter that works by allowing you to insert shortcodes which are parsed into audio players. The players may be placed anywhere in the content (ck editor or other text field) using the shortcode, for example: [smplayer tag=audio1] The output will be a default single player (as specificed in the module settings), or if multiple audio files have the same tag, and you don't specify a type (UI), it will default to the Bar UI for the playlist. You may also specify page-player for the type as it also supports playlists. Here is a more complex tag: [smplayer tag=audio1 type=bar-ui color=2288CC] the tags available on shortcodes are: tag - *required to find the audio file on the page type (the type of player) limit (limit the number of files to load when using a playlist) Player specific tags for Bar UI: bar-ui (options for the bar-ui player) skin (applies to a bar-ui skin to load) extra (when set to true, it will display the extra controls) color (hex value for color - applies to bar-ui and mp3 buttons) compact (makes the player very narrow) playlist-open (make the playlist drawer open instead of needing to click the playlist button to open it.) dark-text (instead of white) flat (remove the faux 3d effect) When using the shortcode, you can chain the tags using underscore, for exmaple: [smplayer type=bar-ui bar-ui=flat_playlist-open_dark_text] Player specific tags for Cassette: cassette (options for the cassette player) In case you are not familiar with SM2, it powers a lot of major audio on the web, like Soundcloud, LastFM, AllMusic etc). The players are all rock solid and work on a wide range of browsers and devices. Features Multiple Audio Formats SM2 supports many formats, and those can be enabled/disabled in the module config if you want to prevent any from being loaded. So far this module was tested with MP3 and AAC (.m4a). GetID3 Support When enabled, ID3 tags from every audio file that pass through the Textformatter are read and cached as arrays using WireCache. Therefore the first load of a page with new audio files may be slow while the tags are read and stored. The tags are indexed by the filename of the audio, so as long as you don't upload multiple files with the same filename, or change the tags, the system will store the metadata permanently. To remove any metadata, you would need to use Soma's Cache Admin module, or clear it from the database. Schema Support When enabled, some schema tags relating to audio files will be added to the markup. CK editor Plugin Very basic dropdown that inserts some pre-configured player codes into the editor. Copy the plugin into your CK editor plugins folder, enable and add a button for 'soundmanager'. Instructions Before you install: 1) You will need a files field that accepts audio files, so set the extensions you want to use, such as mp3, m4a, mp4, wav etc. 2) Also make sure that you enable tags on the files field because the module references the tags for any audio file in the shortcode. 3) Add the files field to your template. Installation and Setup 1) Install the module and adjust your settings from the module configuration screen. 2) Add the TextformatterSoundmanager textformatter to the field where you want to insert audio (e.g. 'body'). 3) Optionally install the CK editor plugin to enable quick access to preconfigured shortcodes. 4) Add a shortcode into the textarea field that has the textformatter applied to. 5) You must reference the tag you entered in the audio file's tag field in the shortcode, and that will create a player for that audio file. 5a) To create a playlist, put the same tag in multiple audio files. Output 1) In order for the module to output the necessary styles and scripts, you need to echo the $config->styles and $config->scripts arrays into your site's header/footer. Here is an example: // In Header foreach($config->styles as $style) echo "<link rel='stylesheet' type='text/css' href='{$style}' />\n"; // In Footer foreach($config->scripts as $script) echo "<script type='text/javascript' src='{$script}'></script>\n"; API Usage To access the module's player method directly, you would first init the module in your _init.php file: $sm2 = $modules->get('TextformatterSoundmanager'); then anywhere in your templates, you can output any audio file with any player, in an configuration like this: $options = [ 'type' => 'bar-ui', 'skin' => 'gradient-fat', //'tag' => 'audio1', // tag is not needed when using the API //'bar-ui' => 'playlist-open' //all of the classes to apply to the bar ui. ]; foreach($page->audio as $track) { $content .= $sm2->player($track, $options); } Advanced Features Using other pages for storing music as playlists. You can create a field to hold a tag for a **page* and then refer to that tag in your shortcode. The shortcode word would be smplaylist instead of smplayer. The module will search the site for pages with that tag in that field. Then it will output all of the audio files in that page's audio field using the player and settings you specify. See the module configuration to select the tag field and adjust your shortcode words. Caveats Some player will not work well on the same page as other players. Bar UI and Page Player 360 Player and 360 Visual (large) players Also note that the cassette player can only occur once on a page. You can have multiple cassettes output, but they will all play the same audio file. The file that the cassette player uses is set in the script tag. In the future the setup may be modified to allow for cassette players to have their own audio files. About Soundmanager2 http://www.schillmania.com/projects/soundmanager2/ Speak and be heard More sound, in more places Despite being one of the senses, sound has largely been missing from the web due to inconsistent technology support. SoundManager 2 bridges this gap, making it easier to use audio across a growing variety of devices and platforms, both desktop and mobile. HTML5 + flash hybrid Complexity, reduced Supporting HTML5 audio can be tedious in modern browsers, let alone legacy ones. With real-world visitors using browsers ranging from mobile Safari to IE 6 across a wide range of devices, there can be many support cases to consider. SoundManager 2 gives you a single, powerful API that supports both new and old, using HTML5 audio where supported and optional Flash-based fallback where needed. Ideally when using SoundManager 2, audio "just works." The ginsu knife: 12 KB Big features, small footprint Performance is an important metric, too. SoundManager 2 packs a comprehensive, feature-rich API into as little as 12 KB over the wire when optimized; that's less than 8% of the original, uncompressed file size. SM2 is self-contained, having no external dependencies, and is compatible with popular JavaScript frameworks. The source code is BSD-licensed and is provided in fully-commented, non-debug and compiler-optimized "minified" versions appropriate for development and production use.
    6 points
  2. Just a bit of an explanation for the next guy....: This will retrieve the pages, return a PageArray (PHP Object), which might end up using a lot of memory. Instead what you want is just the count of pages... Which brings us to this. This is very efficient. It will only count these pages and return an integer, not only doing its job very quickly but using next-to-nothing memory.
    5 points
  3. You couldn't be more precise! GraphQL and ProcessWire fit each other very well. All this module does is just maps the ProcessWire's fieldtypes with GraphQL type system. It literally tells GraphQL that FieldtypeText is a StringType, FieldtypeDate is DateType and so on. And for getting the data, on average, it is less than a single line of code . Since you can access value of a page field like $pages->$fieldName all primitive fields inherit a method for accessing data from one place. I sure having lots of fun writing this module. I agree with Drupal "godfather" totally. The need for quick bootstrapping of an api service with flexible content structure is in very high demand. I had a hard time landing a job as a ProcessWire developer. So I target myself as a full-stack SPA developer in React.js/Node.js. I tried many of open source REST frameworks in Node.js that would help me get started with a project quickly. But non of them offered enough flexibility for my style of programming (I guess ProcessWire spoiled me ). At the time I figured out the best way to build REST api in Node.js I found out that REST is not flexible either. When an app starts evolving REST gets very messy. The Github built three versions of their REST api and still are not happy with it and now decided to release a GraphQL api which probably will not introduce breaking changes in the future, because GraphQL is designed that way. I think if made correctly, this module could bring a great value to many ProcessWire users. That's right. That is the main goal of this module. I will eventually implement all the features that needed to build a complete SPA with this module. I just try to move carefully and a usage feedback from community would help a lot. Just installing it and making couple queries to confirm that it works as expected would be great.
    4 points
  4. @Zeka, No is the answer This will first return the PageArray (i.e. load pages) and then do an in-memory count. More like counting items in an array. This will do the counting at the db-level, hence faster and more efficient if all you want to do is count.
    4 points
  5. Generally speaking you're, of course, right -- in most cases one should use built-in visibility settings and permission-related hooks, but it's not unheard of to check permissions in a template file either. Depends a bit on the use case. And yes, you're right that in such cases it may be preferable to avoid installing such a module at all. Obviously this is mainly a problem with systems that include a enabled-by-default (or always enabled) built-in public API, and less so when enabling/installing the API itself is a conscious choice. Either way, it's good to understand that exposing your content to the world via a publicly queryable API may uncover some surprises. This is one of the reasons why I find certain value in the idea of crafting the API per current needs and so that it only exposes the minimum viable amount of data Note: don't get me wrong, I'm definitely not against this module. What I've said here is mostly theoretical. I also think that your idea of being able to manually define queryable templates makes a lot of sense. While I'd still suggest enabling a selector instead, you obviously know the use cases (and the implementation) better.
    3 points
  6. Hello @Kass and welcome to the forum ! Your issue is easy to solve. So just after your div/container, add another div, for example : <div id="meanmenu-container"></div> after that - I am sorry I included the minified version of meanmenu - edit jquery.meanmenu.min.js and seek the property meanMenuContainer then add as value our new div: '#meanmenu-container' [...] meanMenuContainer: '#meanmenu-container', // Choose where meanmenu will be placed within the HTML [...] Now the languages bar should be above of the responsive menu (thanks Kongondo)
    3 points
  7. This sounds good, and that's basically everything that a "generic", publicly accessible API can do. I've got no complaints here What I've found out while playing with the WP REST API a while ago is that even though permissions are sensible, it may end up showing more than the public site. Part of it is about things like (not just page but) field level permissions, and part is about pages that exist and are publicly viewable for technical reason, but are not *intended* for public consumption, if you get what I mean. Surely it would be best to always use native permission rules to limit the visibility, but sometimes a site may have content that is viewable only if you know the direct URL, and a public API like this may make it "more public" than the developer intended. Another thing is that there may be a code-level permission check in place, and a module like this would have hard time figuring that out. That being said, have you already implemented or are you considering implementing custom selector support for such limits? I.e. allow the developer to manually define a selector that returned pages must match, or alternatively should never match? I think that could make a lot of sense from a security point of view, particularly for public API endpoints, where it might actually work best as a per-endpoint setting
    3 points
  8. $pages->count('template=posts-content');
    3 points
  9. Thank you very much for this module, @Nurguly Ashyrov! I missed this graphql thing completely, though was messing around json api a bit. Had some great time reading about it. Seems like ProcessWire fits graphql like a glove. Your module should answer a lot of recent questions about integrating PW with vue.js and alike. Dries Buytaert, the Drupal "godfather", has a nice article in his blog about the necessity for a contemporary CMS to have support for web-services built in. And his choice seems to be graphql and json api. I am sure that improving and promoting PW as a "headless CMS" kind of thing is something that could bring a lot of frontend developers to use PW. This module is the perfect start. As I understand, mutations are a way to not only read, but write data? If so, that is certainly worth implementing, so a complete SPA could be possible with this graphql module alone.
    3 points
  10. Hi all. For a while now been wondering how many would be interested in a backend and frontend shop catalogue built on top of PadLoper? I've previously spoken to @apeisa about this and his take is that there are no plans to develop PadLoper in this direction but he's happy to support such efforts. The gist of the backend shop catalogue is to provide one place (think ProcessModule) where you can manage your PadLoper products - add, edit, delete, track sales, etc without having to set up the underlying structure yourself. The frontend would be like a shop/webstore profile, a frontend cart basically, that's customisable. The shop would be 100% powered by PadLoper. This means that to use the 'shop catalogue' would require that PadLoper is installed. These are just loose ideas at the moment for a pro module. This might or might not see the light of day depending on feedback. Anyway, would love to hear thoughts, thanks.
    2 points
  11. I hope you seriously get this working. I would gladly support a commercial module with the feature set listed. Good luck, as always.
    2 points
  12. @kongondo That reminds me: maybe you also want to go the "markup regions + UIkit" way so that it will be customizable in ways that are already documented and quite powerful.
    2 points
  13. That is a super idea Kongondo! I hope you find the time to do it. Padloper is great, but like Ryan, is taking time to develop the new PW themes. If there were premium modules, a default theme, a customer area, that would probably boost padlopers sales.
    2 points
  14. Hello Kass, and welcome to the group. Can you also post the section that includes your mean menu. It is difficult to tell where any issue is with this code segment, as the only class designation is when the viewport is x-small.
    2 points
  15. By the way, in terms of security, this module follows the permission settings in ProcessWire. All it does is collects the templates that are viewable by the client via $user->hasPermission('page-view', $template); and for every request it makes sure to returns only those pages that have one of those templates. So, as long as user does not have permission to view the page, she won't be able to fetch it. I tried to make module reflect your existing settings as much as possible. It basically delegates everything possible to ProcessWire itself. That is so true. I personally thought GraphQL was new SQL.
    2 points
  16. FieldtypeFileS3 https://github.com/f-b-g-m/FieldtypeFileS3 The module extends the default FieldtypeFile and InputfieldFile modules and adds few extra methods. For the most part it behaves just like the default files modules, the biggest difference is how you get the file's url. Instead of using $page->fieldname->eq(0)->url you use $page->fieldname->eq(0)->s3url(). Files are not stored locally, they are deleted when the page is saved, if page saving is ommited the file remains on the local server until the page is saved. Another difference is the file size, the default module get the file size directly from the local file, while here it's stored in the database. There is an option to store the files locally, its intented in case one wants to stop using S3 and change back to local storage. What it does is it changes the s3url() method to serve files from local server instead of S3, disables uploading to S3 and disables local file deletion on page save. It does not tranfer files from S3 to local server, that can be done with the aws-cli's through the sync function. Files stored on S3 have the same structure as they would have on the local server. -------------------------------------------------------- -------------------------------------------------------- Been struggling with this for quite a while, but i think i finally managed to make it work/behave the way i wanted. All feedback is welcome!
    1 point
  17. Just cross-referencing an almost identical question asked an hour or so after yours:
    1 point
  18. Have you tried something like this? $out = ''; foreach($page->page_table_field as $p) { $out .= $p->render(); } echo $out; Of course, change $page as needed
    1 point
  19. @JoshoB - I would recommend installing and configuring http://modules.processwire.com/modules/wire-mail-smtp/ so that all your emails will go out through SMTP, rather than PHP's mail() I have no problems here on multiple sites with the forgot password module, so guessing it is an issue with your outgoing emails. You could also install TracyDebugger and turn on the Mail panel which will intercept outgoing emails - this will let you know whether they are in fact being triggered for sending by PW which can help to narrow down where the problem might be.
    1 point
  20. Are you receiving any errors or is the email simply not going through? Checked the logs?
    1 point
  21. Not sure if there's a solution yet, but there's an open issue in PW's github request page already. Upvoting that may heighten the chance to see it implemented.
    1 point
  22. @Robin S Sorry for the very very late reply ... And thanks a lot - your solution did it for me .) Cheers Simon
    1 point
  23. @mel47 You can only apply one textformatter for a field. You're right, I'm using sanitizer textarea to sanitize the input values. And the default option – which will be provided to the textarea() sanitizer – is: // strip markup tags 'stripTags' => true, Therefore all tags are gone. I updated the sanitizer usage and set this option to `false`. Please update the module and try again!
    1 point
  24. I have not thought about this kind of security layer. Though it sounds reasonable. I will keep in mind this option. For now I plan to add an option to limit the templates that are meant to be accessible via public api by explicitly selecting them.
    1 point
  25. @flydev & @szabesz I have already placed the keywords in place for every page I need them and now am able to select already existing or add a new if needed so now I am aiming at showing some "top" keywords on the main page. And to be clear, by "top" I most probably would select to choose the tags that were used the most. Btw 'reading the morning coffee first' made me laugh @Robin S thanks for your suggestions. I would give a try to the Connect Page Fields & Ryans SQL query and see how can I fit in the keywords appearance.
    1 point
  26. Any clue how I could start that ? If the module is a Process module you can create and require a custom permission in the module info (that is, getModuleInfo(), etc). See the ProcessHello module for an example: https://github.com/ryancramerdesign/ProcessHello/blob/9c1aa18eb40d069c7fb227f09badddc90f0b3276/ProcessHello.info.php#L33-L39
    1 point
  27. Well, so I did not understand the question after all Maybe I should drink my morning coffee first
    1 point
  28. There is no built-in method to do this efficiently in PW - to use normal selector queries you would need to iterate over all tag pages, for each tag counting the pages that have that tag selected, then sorting by count. This is one of the things that prompted the Connect Page Fields module
    1 point
  29. Something like the below in your module's init() method. You can of course change it to lookup a role or roles or some user IDs [if(!in_array()...]. public function init() { if ($this->permissions->get('duplicator')->id && !$this->user->hasPermission('duplicator')) throw new WirePermissionException($this->_('Duplicator: You have no permission to use this module.')); }
    1 point
  30. As @szabesz already spotted it, scheduled cron job is already implemented using PwCron. About the Event-trigger dropdown, its meant to work with LazyCron but I had in mind to give a try to interact with PwCron directly from the interface of Duplicator. For the situation where a package will be built manually at the same time as a scheduled cron job, there is a File Locking technique implemented, so it should not be an issue. It should not be a problem - In the todo list ! Thanks you ! Any clue how I could start that ?
    1 point
  31. of what subject matter? Words/expressions used as tags depend on the context in which they are used, that is why normally none of them is provided by default and it is the author(s) of the articles who is responsible to come up with useful ones. And this is the hardest part of tagging, because doing it right requires thinking carefully ahead of time as much as possible. Sites are mainly organized into topics/categories via the menu system and normally one should not use a topic for tags which is already used as part of any of the menus. One needs to figure out the most important topics first, then articles can be grouped by those tags. Say we have a school's website, tags can be: competitions, charity, summer camps, state, regional, city, etc... It all depends what one normally writes about. I hope I understood your question correctly
    1 point
  32. Hehe, 404 replies! (Wonder why the topic tags are stretched out like that...) Anyways, for those of you who have not seen this yet, here's an update on progress. When v2 is ready for a release of any kind, I'll create a new thread for it. v1 will continue to be supported for those who still use PW 2.7- (for everyone using 2.8+, there will be no reason to stay on v1). v2 will have it's own repo (or perhaps I'll have v1 have it's own branch, and v2 will be dev/master -- maybe that's better).
    1 point
  33. Hi @ryan Thank you once more for the new site profile! I've been "playing" with it and found the following issues that might need improvements: Preview image of the site profile is too big. Newcomers might not find the Continue button easily during the install process, especially that it blends rather well with the image of the screenshot. Categories should be named Tags, I think. In the context of a blog it looks more like tagging, or am I missing something? Is it intentional that the recently added requireHoneypotField is not part of the form? The X buttons added by uk-alert-close do not close their respective panels, neither in the case of the comment form nor in the case of the search form. Anyway, are they needed in these contexts? They look kinda useless to me, but maybe it's just me... That's all for now
    1 point
  34. @kongondo Thanks, I got the menu working with a custom menu builder functions. I couldn't help myself from digging around the in the the module code, though . I think I've found what seems to be a fairly simple solution to the quoted attributes breaking the form output. In ProcessMenuBuilder.module, on line num. 1111: https://github.com/kongondo/MenuBuilder/blob/bfc032cb3a07b65e732469b16b5286563bd709e9/ProcessMenuBuilder.module#L1111 Change: <input type="text" value="' . $title . '" name="item_title[' . $id . ']" class="menu_settings" id="item_title' . $id . '"> To: <input type="text" value="' . htmlentities($title) . '" name="item_title[' . $id . ']" class="menu_settings" id="item_title' . $id . '"> The htmlentities() function deals with the issue of quotes breaking the form input. I've tested it on my site and it seems to be working just fine. The icons display in the front-end and the admin widget item label, and the code displays in the item's title edit field after being saved. I don't know if I've missed anything though?
    1 point
  35. http://duckisland.com/GreekMachine.php
    1 point
  36. This is already implemented as far as I can see in the preview gif. The module requires PwCron and in the Event trigger dropdown there are time intervals to choose from. This is where an "OnSubmit" option is also included, but that one needs to be turned into a standalone button. @flydev That reminds me that you will probably need to handle the situation when a scheduled cron job will try to run while a manual backup is running (and vice versa...) I guess it is not a good idea to let both run at the same time. Edit: but I might be mistaken about the two jobs running parallel being a problem... I was just guessing here.
    1 point
  37. @Nukro - what you are after is certainly possible, but I am not sure the best way to make it handle everyone's need and not break current functionality for existing users because at the moment the module doesn't consider anything other than the page ID being somewhere in the URL. This allow ultimate flexibility in the URL, but obviously prevents detection of URL segments. I guess it could be a module config option to consider everything after the ID as segments that should be parsed. Anyway, for now I have attached a version that should do what you want. Please test thoroughly and let me know how it goes. If it's working fine at your end, I'll probably make the urlSegment detection optional and release it. ProcessRedirectIds.module
    1 point
  38. This isn't actually an installable profile though - you can explore the template files but without the database from the demo site it's not as useful as it could be. @ryan, could you please make an exported profile of the demo available?
    1 point
  39. @mel47, Please see this note on how to call a menu in a multi-lingual environment: If that doesn't resolve your issue, try refreshing your file compiler cache.
    1 point
  40. May be starting with something small like a subscription service. Then making things a little more complex like a T shirt shop. Then a more complex one with features similar to woocommerce or something like that. I think is a wonderful idea.
    1 point
  41. Not sure how you got the rectangular thumbnails - mine are always square when rendered inside a PageTable, regardless of the the image field settings. Which isn't a bad thing in this case because the solution involves overriding the JS image sizing with CSS and you're not going to be able to preserve the aspect ratio for each image. These custom CSS settings (use AdminCustomFiles or AdminOnSteroids) gave the result that follows. .Inputfield_pt_thumbnails .InputfieldImage .gridImage__overflow img { height:100%; } .Inputfield_pt_thumbnails td:nth-child(2) .InputfieldImage .gridImage__overflow { height:260px !important; width:260px !important; } .Inputfield_pt_thumbnails td:nth-child(3) .InputfieldImage .gridImage__overflow { height:100px !important; width:100px !important; } There is no way to identify individual image fields from the markup so you have use nth-child() selectors to target table columns. Portrait-format images will not fill their frames.
    1 point
  42. You seem to be stuck on sass and I am talking about having PW profiles that a basic beginner (who may or may not know anything about sass) can utilize. We are coming together from two totally different planes. Yes, I believe it was fantastic and a good trend that @flydev augmented the profiles by including the precompiled version. It should be a great learning tool for all.
    1 point
  43. This thread is already quite old, but I just stumbled upon the same problem and wanted to add my solution to this thread. When you install the LanguageSupportPageNames module, you also get the Page::localName($language) method to easily retrieve the page name in different languages. This has been added in 2.3.0. So, to get the page name in a the language (or any other), you could do something around these lines and be done: // Get default language $defaultLanguage = $languages->getDefault(); // Get default page name $defaultName = $page->localName($defaultLanguage);
    1 point
  44. That's a good point. I remember that I changed something like that a long time ago. I found my snippet sql errors - check (mysql 5.6.15): sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" remove STRICT_TRANS_TABLES
    1 point
×
×
  • Create New...