Leaderboard
Popular Content
Showing content with the highest reputation on 09/25/2015 in all areas
-
Hi, I'm not sure if this can be useful or not. Check by your self. I have created a little module around a set of 42 svg icons. (nearly a copy from Windows 10 iconset). It is very rudimentary at the moment. One can define settings for colors and size of the svg variations. Variations will be created on demand in a central directory (assets/svgicons/) and cached for later usage. The settings can be passed as selectorstrings. You can use a template variable $icon. To output markup for a plain svg icon in an image tag, you need to call the name: echo $icon->img("name=lock"); echo $icon->img("name=unlock"); If you want use it as a rollover with hover state, you need to call the function markup: echo $icon->markup("name=attention"); This gives you markup with default settings. If you need a clickable link, just define it in the selector string: echo $icon->markup("name=attention, link=/about/"); You can set / change the default values from template like: $icon->setColors(array(0, 111, 187, 0.2), array(219, 17, 116, 1.0)); $icon->setSize(180); and / or you can use individual settings for each icon: echo $icon->markup("name=document, size=32, color1=#775599, color2=blue, link=/about/"); // HEX colors or named colors echo $icon->markup("name=idea, size=120, color1=255-255-0-0.3, color2=255-255-0-1, link=/about/"); // RGBA colors echo $icon->markup("name=home, size=20, color1=230-0-0, color2=230-0-0, link=/about/"); // RGB colors . For the rollover / hover markup there is a piece of css needed what can be outputted (only once). It can be fetched with or without the style-tags: echo $icon->css(); // with style tags echo $icon->css(true); // suppress the style tags . The functions that does not output markup return the module itself (the $icon object). So you can use them chained: // all functions that can be chained: $icon->emptyCache()->setSize(100)->setColors(array(0, 111, 187, 0.25), array(243, 79, 159)); // after such a (re)set call, you only need to pass a name to each icon call to get consistent results: echo $icon->markup("name=lock, link=/logout/"); echo $icon->markup("name=unlock, link=/login/"); // you can override single settings, ->mu() is a shortcut for ->markup() echo $icon->mu("name=trash, size=200"); echo $icon->mu("name=key, color2=red"); // ->presentation() print the whole collection with optionally individually specified size and colors: echo $icon->presentation(100, array(0, 111, 187, 0.25), array(243, 79, 159)); . . . The code is here in a gist: https://gist.github.com/horst-n/f6922f6fa228991fd686 . Download it as ZIP! . . A live demo is here: http://images.pw.nogajski.de/svg-icons/ . .12 points
-
I have liked the Default theme from the beginning and I also think Reno is a great alternative. I use the Default theme all of the time. Occasionally, I will use the Reno theme just to make sure any client using it won't have any issues. My clients have never had a problem with using the Default theme. Some of them do like the Reno theme and some of them are more comfortable with the Default theme. I like the fact that you actually have a choice in ProcessWire and certainly wouldn't mind if there were more alternative themes.2 points
-
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.2 points
-
Update regarding the HTML builder: This is obviously something that people would be interested in, especially when it comes to getting forms up and running as quickly as possible. However, it should be noted that I don't intend on making a full suite to handle this due to the fact that every form is different, and every scenario cannot simply be assumed. However, the builder will be able to output simple form layouts that do not require specific attributes to be set. At best, the JSON configuration for each form will accomodate classes/IDs for each input field, and will output the form in either Bootstrap, Foundation, or ProcessWire InputField format. If that doesn't suit you, then you should build the form yourself. As this is a developer-centric module, it is recommended that you design your own forms anyway. This gives you the fine grained control you may need - flexibility is key, here. I'll continue to work on this for the next week or so, and will push major updates as they're completed. The next major feature will be the builder, or at least a very simple implementation of one. With that said, the module is currently working as expected (form-processing), and already does more than I'd anticipated (input-masking), which puts a smile on my face anyway. I'll also be working on a full set of docs soon. The todo list has been moved to the repo's readme file.2 points
-
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.2 points
-
The dev branch contains the latest updates on FEEL. It has some BC breaks but it's for the better Some highlights: new feature: edit page template on ctrl-click redesigned class system changed edit link html element to "<feel />" wrapper element removed extendable options rewritten & more verbose docs make the helper function the recommended usage mode using "all: initial" to reset all styles of edit links As the helper function is promoted as the main usage mode, perhaps FEEL could be made to a module. Any thoughts on this?2 points
-
Edit: The title of this post has been renamed to use the word "processor" instead of "builder" - this is not a form-building module. I'm currently putting together a simple developer-centric form processor for one of my projects, and have decided that I'd like to release it as a module as soon as it's stable enough. The idea is to separate it from the backend, and use per-form configuration files and templates instead. I could well implement a backend solution for this, but my preference is for it to be developer-centric. For me, this makes it easier to use and, of course, develop. Here's how it currently works: developer specifies forms and their particulars in a JSON file stored in the module's directory. The file includes dictations such as the name of the form, the fields it uses (along with their sanitization/validation rules), template information, and a set of emails to send when the form is being processed. An example of such configuration is: { "contact": { "name": "Contact Form", "fields": { "name": { "sanitize": "text", "rules": { "required": "Please enter your name." } }, "email": { "sanitize": "email", "rules": { "required": "We need to know your email address so we can get back to you.", "email": "That doesn't look like a valid email address." } }, "company": { "sanitize": "text", "rules": { "min(4)": "That's a tad short for a company name." } }, "contact": { "sanitize": "text", "rules": { "int": "Please enter only the digits of your phone number (no spaces or other punctuation)." } }, "message": { "sanitize": "entities1|textarea", "textField": true, "rules": { "required": "Please enter your enquiry/message.", "min(250)": "Please enter at least {$0} (but no more than 2000) characters.", "max(2000)": "You have reached the {$0} character limit. Please shorten your message." } } }, "info": { "fromName": "The ABC Accounting Team", "tel": "(011) 100 1234", "altTel": "(011) 100 5678" }, "emails": { "autoReply": { "template": "auto-reply", "to": "{input.name} <{input.email}>", "from": "ABC Accounting <noreply@abc.accounting>", "subject": "Enquiry/Message Submitted - Thanks!" } } } } As seen in the 'emails' key, templates can be defined for each email. These templates can be plain/HTML/both, and accept information regarding form input, the 'info' key, and a custom stylesheet, which is created as a file, but imported directly into the HTML version of the template. The module will also come with a jQuery module to assist in processing the form. Frontend is up to the developer/designer. Currently, the directory structure of the module is: root - forms.config.json / templates / form-name - template-name.html - template-name.css - template-name.txt I'm now thinking that it would be better to change the structure to this: root / form-name / templates - template-name.html - template-name.css - template-name.txt - config.json That is: each form will have its own folder containing configuration and templates. So I'm starting this thread to ask the following: Firstly, what do you think of this idea, and do you think you would make use of this module? Of the two structures above, which one would you prefer? Would you want the ability to make use of attachments in your emails (such as a logo)? (If I'm not mistaken, we'd then need to require WireMailSmtp or WireMailSwiftMailer...) As a side note, it's worth mentioning that this module is really intended to be used on small- to medium-sized sites that require multiple forms where developers are not in a position to obtain Ryan's excellent FormBuilder. Any input here is most welcome. (And yes, as gathered by my signature, the module is called SimpleForms. If you have a name suggestion, please feel free...)1 point
-
Plyr Media Player for ProcessWire ! beta status. This module is "work in progress" v0.2 ! Please be patient as this is my very first public module ^^ This module adds the Plyr HTML5 Media Player (plyr.io) to ProcessWire. Plyr is basically a wrapper for the natural media interface in modern browsers. It adds the ability for easy styling via CSS and a sprite, while being fully responsive. Also Plyr gives you full controll over the player with its great javascript interface. MarkupPlyrMediaPlayer incorporates Plyr for ProcessWire. -> GitHub -> Module directory Current capabilities After installation, you will notice some module configuration options. These are: - Automatic Mode If enabled, this option will automaticaly add all needed resources into your pages output. - Use CDN Use the official Plyr CDN (Content Delivery Network) for resources? The following resource options are only required if you don't wish to use the CDN: - Path to CSS file (Path to your CSS file, required to style the players.) - Path to Plyr library (Path to the Plyr javascript library, required for the functionality.) - Path to SVG sprite (Path to your SVG sprite image file, required to style the players.) Automatic mode If automatic mode is enabled, the module hooks after the page rendering and automatically adds the stylesheet to HTML head. Also adds an AJAX call to fetch the SVG sprite and the Plyr javascript library right before the ending body-tag. Also, while in automatic mode, that extra markup will only be rendered if a template made a render request for a Plyr player. So there will be no unnecessary load on your site. Get module $plyr = $modules->get("MarkupPlyrMediaPlayer"); Add a video player to your template echo $plyr->renderVideoPlayer($poster, $mp4, $webm, $captions); The $captions-Array contains details of the caption tracks: $captions = $caption = array(); $caption['label'] # Something like "English captions" $caption['src'] # http://...movie_captions_en.vtt $caption['srclang'] # en|de|ru|... $caption['default'] # true|false array_push($captions, $caption); Add an audio player to your template echo $plyr->renderAudioPlayer($mp3Path, $oggPath); Add the YouTube-wrapper to your template echo $plyr->renderYoutubePlayer($videoId); Manual mode If automatic mode is disabled, you have to render these parts manualy in your page template. Important: This method will not check if a player was requested. In the HTML head: <html> <head> ... <?php echo $plyr->renderHeadLink(); // Basicly just a <link rel="stylesheet" href="..."> ?> </head> ... And in the footer somewhere before the closing body-tag: ... echo $plyr->renderScripts; // AJAX call for SVG and JS library inclusion </body> </html> Where is this going? Before getting a v1.0.0 stable release, this module should be capable of following features: - [done] Load resources from CDN or local files - Reliable automatic mode with fallback to local - Brings specific Inputfields for video, audio and youtube for the backend and frontend markup rendering - Every Plyr javascript setting can be handled via module configuration1 point
-
Hi FreeAgent, If I get you right, then you have a page with name "blog" under the homepage. If the current page is a child of "blog", you want to display the shares, right? if ($page->rootParent->name == "blog") { echo "social share stuff"; } // if this doesn't work, you can try additionally if ($page->rootParent->name == "blog" && $page->name != "blog") { echo "social share stuff"; } PS: the editor button with this sign: <> opens a box for code.1 point
-
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 away1 point
-
Adrian, both ideas sound good. I also have thought if it would be better to only store the <path></path> part of the original icons? So, it is the first time I look into SVG. As I know, you are much more experienced with it. My initial thought was, that other devs can take the gist and build their own modules. Thats why I called it a POC. But the idea with decoupled icon files or storing the icon data into the DB sounds very good. If you like, you can take it over, or you can commit to it. If that isn't doable with gists, we can put it into a github repo. I'm very short with time atm. It was fun to play with this. But for now, my time budget is empty. If you cannot or do not want to take it over, we also can collect ideas and / or code snippets until someone has time to code it in.1 point
-
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?1 point
-
1 point
-
If you want to stick with a password field you can do this: if($page->password->matches($input->post->pass)){1 point
-
1 point
-
Greetings, Terrific! Horst, you should be named "PW Graphics Guru." Thanks for your great work, Matthew1 point
-
You can search for the pages with that tag. $taggedPages = $pages->find("template=myTaggedPagesTemplate, tag=$page"); You can find docs about selectors here: http://processwire.com/api/selectors/ And some in depth into in categorizing content can be found here: https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/1 point
-
Just installed and tried the dev branch and it works really good. Thank you. I really think it should be made to a module. By the way, I added another helper function to use while setting the FEEL js variable. So both local and live server works even if their relative paths are different. But I'm not use if this works with all cases. PHP: function feelPath() { //remove doc root from full wire path for relative wire path $wireRelativePath = str_replace($_SERVER['DOCUMENT_ROOT'],'',wire('config')->paths->wire); return $wireRelativePath; } JS: var FEEL = { wirePath: "<?=feelPath();?>" };1 point
-
1 point
-
I never tried Forward, but ngrok works great with login in the backend https://ngrok.com/1 point
-
That doesn't work. The field visibility would only close the whole repeater field. Also repeaters aren't getting much attention lately as page tables are the defacto better alternative in most cases. There where lots of requests for automatically closed repeaters before page tables came along, but I'm not aware of any solutions.1 point
-
you would retrieve the email address like: $emailTo = $page->Header_select->contactAddress; BTW - you are mixing up your cases, your variable is camelCase, your page select is underscore_case with the first letter capitalized, and your page field is camelCase. For clarity and ease I would recommend at least being consistent with your field naming, e.g. always use underscore_case (no caps) or camelCase.1 point
-
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/14642361 point
-
1,5 month later, after I did most of the project and be sure that I understand PW system, I finally finished that part. It's not perfect of course but it's working fine. Here is how I did it: Templates And Fields: I created 2 templates: grid and grid_item and 1 pagetableextended field grid_items. In grids page I can enter grid_items like below: Title, summary, featured_image for content on the grid items, external url for obvious reasons, grid_ratio is to determine size of item. Design is limited with ratios from 1x1 to 3x3, so I made it selectable page items from options use_border : for images with white bg, so they don't look like they are floating Modules I have created 3 modules. InputfieldGridBuilder,FieldtypeGridBuilder and GridBuilder. Whenever I save the page, new items from grid_items pagetable are available to use like below. I can order items, add new rows, delete row etc. Whenever I change something, there is a method that works to serialize data to the hidden input field,InputfieldGridBuilder. Also, just in case I call the function it every 5 seconds. I make a small fixed grid that is very similar to the one used in the frontend. So anything that you can do here with jQueryui sortables, it's available for using in the frontend. Last module GridBuilder is used for mostly utility purposes for both frontend and backend. It has methods like getItemSize, getItemImage, build etc. Frontend Normally these will be used in homepage but I made the view of page available to users with editing roles, so before using them they can see that it look like. For example this one in the gif above looks like this. So even with the empty rows, it works. And for using in the homepage, I added a multiple selection page field. So they can use more than one grid, or with the location options we already added they can select to have a different view for different countries. (I added Location settings is globally for every page) Questions, critics, feedbacks or "hi,there buddy"'s are highly welcomed.1 point
-
Hello, Me here. I work for a creative marketing agency and I have worked with so many CMS's I dare not count. But some of the leading ones include; Concrete5, Drupal, Joomla and WordPress. We almost always used WordPress over these other solutions. It meant for quicker development times, need a slider? Sure Revolution Slider has you covered. I went on to start building sites by just filling a header and footer in and building the rest in Visual Composer. Sure enough... I got lazy. Now we have over 30 websites running WordPress and they are all running out of date, the WordPress versions, the vast amount of plugins. Keeping WordPress up to date and secure is a job within itself. Then stuff like this starts happening: https://blog.sucuri.net/2014/09/slider-revolution-plugin-critical-vulnerability-being-exploited.html. I now when ever we have the budget for a custom build, use ProcessWire. If I found ProcessWire earlier, I may have never used WordPress for custom builds unless client requested. ProcessWire's API is one of the most powerful I have used and kicks WordPress's WP_Query ass and without a 3rd party plugin (ACF) WordPress is a pain in the backside. ProcessWire is now my one true love and I'm sure destiny brought us together, but I believe we are made for each other.1 point
-
The idea of a separate URL and repo of modules that folks can set up themselves had crossed my mind, but that wasn't what I thought the OP was asking - now I read it again it was I do like the idea of this if it's easy enough to do.1 point
-
Hi there. New to PW but plenty of other CMS experience. Loving PW so far so thank you folks! I've installed Fredi on PW 2.6.1 and using it to create and modify pages just fine. The plan is to let 'front end' users add, modify and delete their own adverts to a site that I'm building. It's all working as planned except the follow up when deleting a page. On clicking the delete tab, checking the confirmation box and finally clicking 'Delete Permanently' the modal confirms (admin style) that the page has moved to trash and then shows the page tree within the modal. As this is a front end delete I'd really like the modal to close and return to a certain page at that point (e.g. a list of the users other adverts). So, my question is...is the page tree view after delete expected behaviour or am I doing something wrong? Code for delete button as I'm using it is: echo $fredi->hideTabs("content|children|settings")->setText("Delete This Advert")->setClass("btn btn-primary")->render("title|vendor|price|body|page_image"); Many thanks in advance. Have already learned a huge about about PW from everyones helpful posts!1 point
-
Another idea that I'm considering, thanks to Pete's name suggestion of QuickForms, is the ability to quickly create forms based on blueprints. One would go to the module's config page, select a blueprint, and then the config and templates would be created for it.1 point
-
Next little tutorial on this really great module... Getting a Footermenu stripped from the mainmenu and output in a footermenu 1. Setup Pagefield for your /settings/ or /tools/ page This solution could be set by the user direct via a simple pagefield to select normal contentpages that a normaly in the mainmenu...but this items should stay not there and render somewhere else... 2. Strip the choosen pages from the mainmenu //get the pagefield content $footerMenu = $settings->footer_menu; //just the needed option listed - other options like needed for your menu $options = array( 'selector' => 'id!='.$footerMenu.'', // define custom PW selector ); 3. Output the pagefield items <?php //in my example i am in the _main.php template and render some footermenu if ($settings->footer_menu) { //check for the pagefield echo '<div class="eight columns">'; foreach ($settings->footer_menu as $item) { if (!$item->is('hidden') || $item->is('unpublished')) { //check for hidden/unpublished pages!! echo '<a href="'.$item->url.'" class="button sendbtn btnSend">'.$item->title.'</a>'; } } echo '</div>'; } ?> hope this is helpful...have fun. I don't have a blog and i am a fan of keeping things together....so don't bother if i'm posting such things here and write me if such usecases are not helpful or nonsense...... Best regards mr-fan1 point
-
After ProcessWire has finished the ready-stage, none of the conditional autoloads are evaluated again (the list of them is even cleared). This means that if you load a module in a template, you are already past the ready-stage and hence no autoloading conditionals will be processed.1 point