-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
@Robin S You Rock!
-
This module is now available on GitHub. Still beta, but working well on all sites tested on. More documentation coming soon. If anyone out there needs inline audio on your site, check this out. ** make sure to read the instructions on Github, as those will always be updated to the latest (hard to keep the instructions here sync'd with the module instructions)...
-
not sure if this could be handled by the module, and haven't researched yet about this... but i wonder about the possibility of hide and unpublish buttons on a page table, because it is something that would save my users a lot of time; example would be we have homepage sections which are handled by a page table. there can be many sections to the page table, but sometimes a user might want to hide one and unhide another one; in the current functionality of PT afaik you need to open the item, go to the settings page and check the buttons... TIA for reading!
-
What is the $c - is that your pageArray? also, this is not much to go in, can you explain more?
-
Hi Joss, nice site, and great music, For the audio players, you should consider trying the new Soundmanager2 module which will be released pretty soon...
-
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.
-
wow that is awesome, the Safari mystery is solved!
-
actually i was wrong about the source code - that is all cached by pro cache, so it would be the same for everyone, unless the generated source under Safari was somehow different based on some set of conditions; i did test it with various ways of loading the google fonts (regular script tag, webfont loader etc, and those didn't seem to make any difference). One of the sites will be live tomorrow, the other is here: https://www.chestnutridgetennis.com/ thanks - and sorry for incoherence, getting late here in NY.
-
the problem here is that i can't reproduce this issue, it was reported to me by some people who sent me screenshots; so i can't get source code, and i can't really test it, until i can find a mac running exactly the same OS and Safari version; those same users said the problem didn't occur on Firefox; and the one user who i had on the phone told me the problem immediately fixed itself when i removed that textformatter... it is possible i may have had something mis-configured with the language code or that removing that would also have fixed it. Font is Raleway... I will probably have to setup a local install next week in order to test the language code setting (both these sites are live now)...
-
This is going to be amazing! - here is a wishlist.., not sure if these can be gradually implemented.. - backup from scheduled cron job - exclude by file extension, for example exclude all .mp3, or .jpg etc; /alternately if the above is not possible, then the existing functionality of excluding directory would be ok (like exclude the site/assets/files in case that folder is multiple GB; we often just sync that folder with an S3 directory to keep a backup)... - protect access to the module screen by role/user
-
Yes thanks - didn't mean to imply that the module would be able to solve this... here is an example screenshot:
-
really nice!
-
Just wanted to stop by here and say thanks for this module, I'm hoping to use it on a lot of sites, once I can work out how to fix the possible issue described below... I have 2 projects that i was using it on, and for me it was working fine on all my browsers, 5-6 laptops and 2 desktops; the snafu that I ran into was that users on some Safari versions, both on iPad and desktop were reporting google fonts looking garbled and corrupted. I did a lot of troubleshooting, without really considering that this textformatter could be the culprit, but having just got off the phone with a Safari 9.1.3 user, they confirmed that the google fonts appeared all fixed and the problem solved once i removed the textformatter... If you want me to report this on Github, i can do that, just wanted to post here, in case anyone else runs into this problem (and it is probably only seen by that minority of users who are using Safari, on a specific OS X, possibly 10.9.5); it does work and look fine on Chrome and Firefox...
-
You would need a date field on the 'page'. Sorting by date would be easy; outputting the date or using words like Yesterday and Today would require some if/then tests on the output listing, using date comparison; you may need to study this: http://php.net/manual/en/function.date.php
-
@KarlvonKarton so the issue you are having is that the child page is access restricted and that's why you get the blank screen; to solve this you just need to add a selector to the child api call like so: if ($this->page->id == 2) { $childPage = $this->page->child('check_access=0'); $this->session->redirect($childPage->url); } then you don't have to hardcode the ID of the dashboard page into the module... Somehow this may have worked as it was originally in earlier versions of PW, but i encountered the same issue as you and had to make that change.
-
Image field: check if first image is under a certain width
Macrura replied to OpenBayou's topic in API & Templates
i can show a simple module to do this, the only thing delaying me right now is figuring out how to prevent the publish - I guess if you hook into saveReady, then you can check to see if the page status is published (since the request would have that set) and then if the image requirements are not met, you would set the status to unpublished, overriding the request; haven't tested this yet but will do so soon.. ok here is a try - note that once you install this module, you can keep adding stuff to it by adding your hooks to the init and then your functions below. -
i have been using/testing this on the last 2 projects.
-
cool thanks!, i added that and bumped the version
-
I sometimes use this module for selecting files: http://modules.processwire.com/modules/fieldtype-select-file/
-
just chiming in.. wanted to +1 for the idea of names/descriptions; and i would have no problem with the inconsistency of some not having descriptions.. hopefully it's not too much extra work (?)
-
Create a Module: image upload to another page and autocomplete
Macrura replied to Qualtext's topic in General Support
thanks, i hadn't noticed there was actually a module (thought it was a mockup)- 7 replies
-
- image
- autocomplete
-
(and 2 more)
Tagged with:
-
Create a Module: image upload to another page and autocomplete
Macrura replied to Qualtext's topic in General Support
i didn't study your posts, but i'm pretty sure what you are doing is all easy to accomplish with the Selectize input field; i do that all the time, in fact i have (e.g.) a media select field that dynamically shows all of the media in my media library, including the media type (image, file, audio, video) and can dynamically show images if/when they exist, as well as image dimensions, and any other info. Maybe take a look at this and see:- 7 replies
-
- 1
-
-
- image
- autocomplete
-
(and 2 more)
Tagged with:
-
<?php function renderUkGrid($page) { $summary = truncateText($page->product_description); $out = "<div class='uk-grid uk-grid-large'>"; $out .= "<div class='uk-width-medium-1-3'>"; $out .= "<div class='uk-panel uk-panel-box prodotto__panel-mod'>"; $out .= "<div class='uk-panel-teaser'>"; $out .= "<div class='uk-cover-background' style='background-image: url({$page->product_image->url});'>"; $out .= "<img class='uk-invisible' src='{$page->product_image->url}' width='600' height='400' alt='Placeholder'>"; $out .= "</div></div></div>"; $out .= "<a class='prodotto__panel-links prodotto__panel-links-blue' href='{$page->url}'><span>Discover more</span></a>"; $out .= "</div>"; $out .= "<div class='uk-width-medium-2-3'>"; $out .= "<div class='prodotto__descr'><span>{$page>product_options->title}</span>"; $out .= "<h3 class='shadow-blue'>{$page->title}</h3>"; $out .= "<p>{$summary}</p><p><a href='{$page->url}'><i class='uk-icon-chevron-circle-right uk-margin-small-right'></i>Link</a></p>"; $out .= "</div></div></div>"; return $out; } foreach($page->children() as $grandchild) { if($grandchild->children()) { foreach($grandchild->children() as $child) { echo renderUkGrid($child); } } else { echo renderUkGrid($grandchild); } } i think this is how i would do it, or i wouldn't use a function, and have a partial for the markup and then do a wireRenderFile(); in either case i would keep the markup out of the loop..
-
This isn't tested, but i use this general sort of thing all the time to change page URLs. It is within the hook function that you need to deal with your logic of when to add the .html and when not to, you will need conditional statements... /** * This hook modifies the default behavior of the Page::path function (and thereby Page::url) * * */ wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'something') { $event->replace = true; $event->return = $page->name . '.html'; } }); Snagged from here originally: