Leaderboard
Popular Content
Showing content with the highest reputation on 02/02/2015 in all areas
-
This is a site for composer, conductor, and NYU composition professor Louis Karchin. http://louiskarchin.com/ The site is based around the works which are presented as a filterable datatable, with inline audio player (soundmanager2).. There is some ajax happening on the works page to pull up details about a work in a popup. a lot of the initial work was importing from the original site as well as from CSV files of the works, so there were various custom import/api scripts used to get all the data in.. As with other recent sites, this site has a admin docs section for reference, as well as inline docs on the edit page, using a simple module based on Nik's page references tab. also this uses the configurable widgets system: and i have an admin page for backups, though the backups run automatically on a cron (using the SmartBackup script): this site benefited from a lot of modules, namely: AdminCustomFiles AdminCustomPages PageDocsTab AdminPageSelectEditLlinks AIOM+ FieldtypeDataStructure FieldTypeTemplates InputfieldSelectExtended HannaCode ProcessRedirects ProcessDiagnostics Profields Table Formbuilder Procache Lister Pro8 points
-
Manlio, you know that if you don't change your avatar until the 60th post, the forum software will change it irreversibly to a random spice girl. You're dangerously close to it...7 points
-
@cstevensjr - yes, it's super easy, this how i do it... 1.) in site plugins, upload the entire SM2 folder that can be downloaded here: http://www.schillmania.com/projects/soundmanager2/doc/download/ 2.) create an alias variable in the init or in config to the plugins folder, e.g. config: $config->plugins = '/site/plugins/'; or $config->plugins = '/site/templates/plugins/'; or _init $pluginFolder = $config->urls->templates . 'plugins/'; note - this example is using both the player buttons and the bar-ui, thus loading both.. IN THE HEAD <link rel="stylesheet" href="<?=$pluginFolder?>sm2/css/mp3-player-button.css" type="text/css" /> <link rel="stylesheet" href="<?=$pluginFolder?>sm2/css/bar-ui.css" type="text/css" /> in foot <!-- Soundmanager2 ============================================= --> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/soundmanager2-nodebug-jsmin.js"></script> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/mp3-player-button.js"></script> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/bar-ui.js"></script> <script> soundManager.setup({ // required: path to directory containing SM2 SWF files url: '<?php echo $pluginFolder?>sm2/swf/' }); </script> where you want to show the player you can copy the markup from the SM2 examples; for mp3 player buttons you just add the class.. "<a href='{$audio->audio_file->url}' title='{$audio->title} (audio preview)' class='sm2_button tip'></a>";4 points
-
Yeah, was to eager to do the comparison of available tags and new tags in lowercase. Should have been only in the if statement and not for the whole value. I've uploaded a fixed version, so it should work now.4 points
-
You will want something like this: public function ___execute() { $this->exportExcel(); } public function exportExcel($event) { header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=name.xls"); header("Pragma: no-cache"); header("Expires: 0"); $this->outputExcel(); exit; } public function outputExcel($data) { // your php://output" code } I used something like this is in: http://modules.processwire.com/modules/table-csv-import-export/ In that module you can test the behavior of downloading directly from a PW menu item by going to Pages > Admin > Setup > Table CSV Export and removing the hidden flag, then go to Setup > Table CSV Export and it will start a download directly from the process attached to that page. The module is not designed to be run directly from that helper page, but it will show you that it can work that way! Hope that helps to get you started.3 points
-
Welcome to ProcessWire and the forums Mukarram. Here you go: https://github.com/ryancramerdesign/ProcessWire/releases - all the way down to 2.2.4 Any particular reason why you need the older version? Just curious.2 points
-
2 points
-
You should take a look at this: https://processwire.com/talk/topic/8697-module-jumplinks/2 points
-
Valid point apeisa, though the BCP47 does already contain this, with the x- extension which is dedicated to private use. I think this would be even more powerful, because it could use the base language as a fall back. For example fr-x-myclient > fr > default/en. That way you wouldn't have to maintain the whole translation strings, just the part you need to specify. I don't know if this would be overkill/technically feasible, but it's an option. Of course free-form could work too, but I would propose like you do that each language be set using a dropdown list of predefined ones (to make support easier), and have a "Custom" entry where an input field would appear to set it as required.2 points
-
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 Settings1 point
-
This is a very simple module that I put together for @Zahari Majini from a PM request. It allows you to enter a URL to a YouTube or Vimeo video in a specified field and when you save the page, it will grab thumbnails for the video and add them to a specified images field. Check the module configuration options for: the field(s) to search for videos name of the video images field which thumbnail(s) you want grabbed whether to grab the first available or all available thumbnails based on those that you list As always, an feedback for improvements is very welcome! Modules Directory: http://modules.processwire.com/modules/process-get-video-thumbs/ Github: https://github.com/adrianbj/GetVideoThumbs1 point
-
I don't normally like wysiwyg web editors or any other similar tools out there but I stumbled upon Pinegrow and I have to say wow. It is useful in so many ways. Description from Pinegrows: 'a desktop app that lets you build responsive websites faster with live multi-page editing, CSS styling and smart components for Bootstrap, Foundation, AngularJS and other frameworks.' Check out the video below for a quick introductory look at it: Just wanted to share this with anyone that thinks this can help their workflow.1 point
-
You can detect whether the current page was loaded from ajax by checking the value of $config->ajax from your template file: <?php if($config->ajax) { // page was requested from ajax } Following that, you will likely want to render the page differently to accommodate whatever you are doing from the javascript side. For instance, you might want do one of these: 1. Deliver alternate or reduced markup when loaded from ajax 2. Deliver a JSON or XML string for parsing from javascript Below are examples of each of these scenarios. 1. Deliver alternate or reduced markup when loaded from ajax You might find checking for ajax helpful when you want portions of pages to load in your site without re-rendering the entire page for each request. As a simple example, we'll use the default ProcessWire site and make it repopulate it's #bodycopy area when you click a page in the top navigation. (To use this example, you'll need the default ProcessWire site templates, though you can easily adapt the example to another situation.) To accomplish this, we'll update our main page template to only include the header and footer markup if the page is NOT being loaded from ajax: /site/templates/page.php <?php if(!$config->ajax) include("./head.inc"); echo $page->body; if(!$config->ajax) include("./foot.inc"); Next we'll update the top navigation to do ajax loads of the pages when the client has javascript (and leave as-is when they don't). Paste this javascript snippet before the closing </head> tag in the header markup file: /site/templates/head.inc: <script type="text/javascript"> $(document).ready(function() { $("#topnav a").click(function() { $("#topnav a.on").removeClass('on'); // unhighlight selected nav item... $(this).addClass('on'); // ...and highlight new nav item $("#bodycopy").html("<p>Loading...</p>"); $.get($(this).attr('href'), function(data) { $("#bodycopy").html(data); }); return false; }); }); </script> Now when you click on any page in the top navigation, it pops into the bodycopy area without a page load visible from your browser. And all pages remain accessible from their URL as well. Note that this is just a test scenario, and I probably wouldn't use this approach for the entire bodycopy area on a production site (it would make bookmarking difficult). But this approach can be very useful in the right places. 2. Deliver a JSON or XML string for parsing from javascript Lets say that you want pages in your site to return a JSON string with the page's id, title, and number of children when it is requested from ajax. When not requested from ajax, they will return their content as normal. To handle the ajax requests, you'd want to add something like this at the top of your template file before any other output. <?php if($config->ajax) { // this is an ajax request, return basic page information in a JSON string $json = array( 'id' => $page->id, 'title' => $page->title, 'numChildren' => $page->numChildren ); echo json_encode($json); return; } // not ajax, continue with regular page output And here is some markup and inline javascript you might use to test the ajax call on some other page (or the same one if you prefer). You would paste this snippet right in your site's markup where you want that info to appear. <ul id='info'></ul> <script type='text/javascript'> var url = '/'; // this is homepage, so replace '/' with page URL you want to load JSON from $(document).ready(function() { $.getJSON(url, function(data) { $.each(data, function(key, value) { $("#info").append("<li>" + key + ": " + value + "</li>"); }); }); }); </script> The above snippet would output something like this: • id: 1 • title: Home • numChildren: 5 To take this example further, you could build an ajax-driven sitemap or any number of web services. Conclusion Hope this helps you to see how simple it is to use ProcessWire to deliver output for ajax. These are just contrived examples, but hopefully examples that might lead to more ideas. In addition, much of what you see in these examples is also applicable to building web services in ProcessWire.1 point
-
InputfieldChosenSelect This topic (https://processwire.com/talk/topic/71-categorizingtagging-content/) showed the need for a Inputfield that would provide a real tagging UI to be useable with FieldtypePage. It uses the chosen library, which can be found here http://harvesthq.github.io/chosen/. It's meant for MultiPageFields and works kinda like asmSelect, but with a different skin. Features: Inline adding of new tags, which will then generate the corresponding pages. Sortable tags. Usage Install the Module Edit your pagefield and choose InputfieldChosenSelect as inputfield. Use Enter or Tab to create new Pages with the currently typed name. Enter will fill in the tab currently selected in the dropdown. http://modules.processwire.com/modules/inputfield-chosen-select/ https://github.com/LostKobrakai/InputfieldChosenSelect1 point
-
I'm happy to announce that the official ProcessWire Developer Directory has been launched at http://directory.processwire.com It comprises a developer list and a map and is designed to allow anyone developing with ProcessWire to find each other. It also allows potential clients to find developers as well as illustrating how widely ProcessWire is used worldwide. The developer list displays in random order so as not to favour any one developer and is currently quite short, but it should grow nicely as you create your own profiles. The login process is linked to your ProcessWire forum account so the same details you use to login here will allow you to get started. There is a manual approval process as well as some rules so that we can ensure that the directory contains quality content and is free of spam. As a minimum, developers must have 10 posts here on the forums before they can login and post a profile, however after that there are relatively few restrictions - as long as you follow the guidelines on the Profile form and abide by the Terms and Conditions (a condition of submitting a profile) you will be fine. You may notice small icons/badges next to some developers - these are designed to recognise special contributions to the ProcessWire project and are awarded by staff as part of the approval process. Whilst checking each entry's content we cross-check against forum profiles, the modules directory and other sources to determine which badges apply to a developer. There are plans for more features over time which you can be notified about by checking the box at the end of the profile form. I look forward to seeing your profiles soon!1 point
-
This is a very simple way to display some instructions to the admin users. Before starting, you need to write some docs; they can be a hidden branch of your page tree, using basic-page, or a different template of your choosing. You should make each subject it's own page under the docs so you can output each one under an accordion trigger. Required Module: Admin Custom Pages 1.) Follow all instructions to install the module; Also add the ACP_scripts_and_styles field to the admin template. 2.) Make a new page under admin, called Docs or whatever; assign the process as described in the module instructions. 3.) Make a template in your themes directory to generate the output of the docs page. 4.) Select that template from the page select in the admin custom page you created. 5.) also make a folder to keep your admin custom pages scripts and styles; 6.) create a css file to use for the display output and some basic styles (like ol, ul li etc..) 7.) Add the custom css file to your ACP_scripts_and_styles field. You can use any output you want, but i'm using a nested accordion, which is provided here: http://tympanus.net/codrops/2013/03/29/nested-accordion/ this is the content of the admin custom page: <?php $docs = $pages->get(4259); ?> <div id="docs"> <ul id="cbp-ntaccordion" class="cbp-ntaccordion"> <?php foreach($docs->children as $doc) { ?> <li> <h3 class="cbp-nttrigger"><?php echo $doc->title ?></h3> <div class="cbp-ntcontent"> <?php echo $doc->body;?> </div> </li> <?php } ?> </ul> </div> <script src="<?php echo $config->urls->templates ?>_admin_custom/js/jquery.cbpNTAccordion.min.js"></script> <script> $( function() { $( '#cbp-ntaccordion' ).cbpNTAccordion(); } ); </script> you'll also want to add the provided css, js and fonts that come with the Nested Accordion; in the css file you'll need to point the fonts to the actual font directory, for example: /site/templates/_admin_custom/fonts/icomoon_arrows/icomoon.eot it should come out looking something like this: *if you are using Reno theme, you can customize the icon, like for example fa-book, which is used in this example: -- Thanks & Credits to Diogo for originally creating the ACP module, and for Nico for getting it to work with the new admin theme system...1 point
-
PW has very flexible UA management. Most of the sites can get the exact needs fulfilled after little clicking. But when you need to scale it in horizontal way: ie. adding ten different news sections, each with same templates but managed by different group of people, PW doesn't make it too easy (since UA is tied to templates). Also roles&permissions&template access is a combination, that at least we cannot leave to our clients (it's way too complicated for your average editor) - it means that UA management have to be done by us. This is fine on small scale, but some of our sites are pretty heavy on UA: biggest site has over 800 user groups and many times we do have something like 50 000 users importet (these sites are not build on pw today, but hopefully they will be). So we need to have simpler UA that our clients understands and can use on daily basis. That will also mean less granular control, but easier to manage. Lucky for us, PW has hook system in place, that is flexible enough to allow hooking to UA also. Few months ago I started building module to add two features for PW: -user groups (user can belong to more than one group) -page based permissions based on groups (so you can say: this page and it's children can be edited by groups A + B and viewed by groups A + B + C I first thought that I should release this as a paid module, but after showing this current early version to Nik and Teppo (I knew they had similar needs) and when they showed interest in development I wanted to make this a community project (this is gonna be thousand times better than just me building it alone). So lot's of progress is coming and of course everyone is invited to collaborate. Be it ideas, comments, testing, use cases etc.1 point
-
I just migrated three of my projects from MODx Evolution to Processwire. The sites itself are not that spectacular but I am a little bit proud that writing a migration script with PW is so damn easy! So I just wanted to share some thoughts how I realized it. Since the projects are very small and have only a few templates and fields it was very easy to set up templates and fields for these three in the PW admin interface (btw: I really like the possibility to export and import fields via the admin!). Template files were more or less a simple copy paste from the MODx backend to the PW templates files. After transforming the MODx placeholders and all that MODx related stuff in "PW language" and after setting up all fields I imported the MODx database tables into my PW database. From this point the migration script started it's work: Step 1: Map existing MODx templates to my newly created PW templates Step 2: Map all necessary fields from MODx to PW fields (based on the previously selected templates) - or just ignore fields I don't wan't to migrate Step 3: List all existing pages and select the pages that should not be migrated (e.g. old sitemap page). From this point on my migrator script did all the work. It created all pages (including the site structure with all its parents and children) and their fields. After importing I just had to copy the content from the old homepage (which was created as a seperate page below the root page) to the root page. That's it. Moving projects took about 1 hour. The most extensiv part in this process was to transform MODx templates to PW, build a new contact form and a menu function. All my projects were without users and permissions so it was quite low easy. At the moment I am working on the migration of a more complex website. This will take much longer but since the PW API is totally easy to understand it's not that hard at all. So thank you all for this great support and this framework! I really appreciate it! Long story short: Here are ex-MODx websites proudly powered by Processwire My own website with some stuff about me: http://brlnr.de And two more sites about events around sailing in Berlin http://www.ansegeln-berlin.de/ http://www.absegeln-berlin.de/1 point
-
I am assuming you mean admin login page? Disclaimer!: Tested and it works but not sure if this is the right place or way to do it..! You might want to wait for the masters to confirm In your /site/templates/admin.php.... //if config debug == true; redirect elsewhere...(you can also redirect to a PW page url) if($config->debug) $session->redirect('http://www.google.com'); But how will you login yourself?1 point
-
On the general question of 'using MVC' in PW, there have been a number of thoughts... https://processwire.com/talk/topic/4892-an-almost-mvc-approach-to-using-templates/ https://processwire.com/talk/topic/6699-use-processwire-in-a-mvc-like-fashion-or-just-use-pages/ https://processwire.com/talk/topic/4947-the-pw-mvc-project/ https://processwire.com/talk/topic/6735-another-idea-for-a-processwire-mvc-approach/ https://processwire.com/talk/topic/5031-get-started-with-pw-mvc-module-by-harmster/ https://processwire.com/talk/topic/821-question-understanding-templates%E2%80%93advanced-templating/ As for your plugging in MVC-built functionality from elsewhere, that seems to be a separate question - about bootstrapping other applications in PW. That is possible, but you might have to contend with variable, etc. collisions, hence the need for namespacing. Others with a better grasp of this will chime in1 point
-
you can create a PDF from a PW page, using the PDF module... it works great1 point
-
Using this module, in combination with the Template Select module, it is easily possible to show inline related documentation on the edit page. Same setup as above, but adding the template select field on the doc template. could also be further modified to support showing a doc only on a specified page, or children of a page, using selector fieldtype.. example module https://gist.github.com/outflux3/3e76a1338b61d708157c1 point
-
Thank you teppo. I know it is a page. I was making one mistake, instead of $page->view_groups or $page->edit_groups i used $page->user_groups and that's the reason why it didn't work. Thak you again. Next time a will look at the template fields better1 point
-
@majkiris: it's quite simple, really. Groups are just pages and view/edit permissions are defined by page fields view_groups and edit_groups. There's also a separate manage_access checkbox field, which defines whether a specific page manages permissions itself, or if it uses permissions from one of it's parent pages. If you want to add a new group, just add a page with template user-group under the groups page at Admin. If you want to grant this new group view permission to a page, find the page and add this new group into its view_groups field. Then save the page, and UserGroupsHooks.module should handle the rest -- though you might also have to enable manage_access (setting it to '1'), can't remember how exactly this worked. Hope this helps a bit. Please let us know if you need more specific instructions.1 point
-
1 point
-
1 point
-
kongondo was saying that the page he linked to has all PW versions all the way down to 2.2.4 - it includes 2.4, 2.3 etc. Weirdly it doesn't have 2.5 though - which you really should be using1 point
-
Welcome, Mukarram. Version 2.4 can be retrieved from here: github.com/ryancramerdesign/ProcessWire/releases/tag/2.4.0 (@kongondo, I think you misread that one... )1 point
-
There's really no difference. $page->child internally calls $page->child(). You really only need to use the function if you want to specify additional selectors like this: $page->child("template=basic-page"); // First child matching this selector1 point
-
jQuery attr seems good to me. Another option may be str_replace on the output something like $out = $nav->render(); $out = str_replace('class="has_children"', 'class="has_children" data-uk-dropdown', $out);1 point
-
This is solvable by using Jumplinks, but especially if there's a potential of a lot of traffic, redirect at .htaccess level would be more efficient. Jumplinks is flexible and easy to use, but the downside is that the whole system has to be started just to realise that "oh, this request doesn't belong to this site at all". Waste of time and resources, really Never seen this particular issue, but it sounds like you're, perhaps, doing this at the end of your .htaccess file, or something like that? The .htaccess file adds ?it=... and in a case like this that part of it shouldn't run at all. As a first step I'd try moving this as close to the beginning of the .htaccess file as possible. This is a simple redirect, so it's quite likely that the issue is something simple too1 point
-
Hi Netcarver, Thank you so much. I would really like to have a demo, will definitely check on lightning.pw. Thanks again for trying out this site profile.1 point
-
It looks like Please has issues with mod_rewrite full stop - I just had a quick Google and there are certainly lots of historical pages like this out there with people having to jump through hoops with it to get it working: http://stackoverflow.com/questions/12130198/php-and-mod-rewrite-problems-on-plesk This may be of use as well as you need that AllowOverride line for .htaccess to work properly (well, as you'd expect anyway): http://www.codero.com/knowledge-base/questions/335/Using+Mod+Rewrite I'm not sure how much help I'm going to be since I've only run into Plesk once and run away about half a day later. I'm a WHM/cPanel man myself1 point
-
Hi Horst: When testing the connection and 'use SSL' is checked these 2 notices appear. (2.5.17 dev) Notice: Undefined property: smtp_class::$result_code in /Users/martijn/Sites/domains/newsletters/htdocs/site/modules/WireMailSmtp/smtp_classes/smtp.php on line 1032 Notice: Undefined offset: 0 in /Users/martijn/Sites/domains/newsletters/htdocs/site/modules/WireMailSmtp/smtp_classes/smtp.php on line 10421 point
-
I think both can be achieved: free-form language names and using language specific language packs for modules. There are certain benefits in not forcing only natural languages - I have used language support for client specific modifications for otherwise shared documentation for example. I think the flow should be something along these lines: When creating new language, UI recommends choosing real language from list (BCP47) or adding custom language name Modules could ship their translations in /lang/xx-xx/ format and if there is match with xx-xx and any languages already found, those languages would be automatically applied for module. There we would have both: convention (using standard languages) and flexibility (using languages for different use cases).1 point
-
And that is entirely fair enough. Search should always return the 'right results', whether that means 'the most accurate & impartial results possible' (Google? Hah!) or 'what we want searchers to find' (say an ecommerce site), or somewhere in between. I have probably mentioned this here before, but I once wrote the search logic for an ecommerce site for one of the biggest fishing tackle retailers in the UK. One of our major brands was 'Daiwa', but a fair proportion (nearly half) of searchers spelt that 'Diawa'. It would have been stupid for me not to have catered for that exact situation and return what people were expecting to find. (SteveB, it used the Porter Stemmer.)1 point
-
Try this: $p=$pages->get("/mypage/"); $p->of(false); $i=0; foreach($p->images as $image){ if($i!=0) $p->images->delete($image); $i++; } $p->save("images");1 point
-
I always start out with a prototype which usually includes 4-6 example pages in plain old HTML, hopefully spanning all the layouts needed in a project. After that, I prefer to work on the actual server which the site will be hosted on, maybe on a subdomain or different folder if it's a relaunch. The reason for this is that in my humble experience, development setups almost never match the setup of the client's server/webspace. There's always some kind of small difference, and I really don't want to waste time on replicating that in a local dev environment. The prototype is usually based on a small starter project (I wouldn't call it a framework) I have built over the past couple of months. This includes a Grunt build script (which I love) including a lot of useful helpers like Sass, Bower, various tools to optmize images, Modernizr, jQuery etc. This also takes care of combining and minifying CSS and JS files, and it can even work with the PW templates I create after finishing the prototype. As for the actual deployment, I haven't included that in the build script. There are Grunt plugins for that, but I'm not entirely sure that would be very secure. So I still use plain old (S)FTP and ssh (if available on the client's server, which unfortunately still is rarely the case) to deploy the actual templates to the (development) site.1 point
-
Hey diogo, thanks for suggesting that. The child page template is now unhidden so ajax calls can be made, but throws a 404 if it wasn't requested via ajax. Like this: if($config->ajax) { content } else { throw new Wire404Exception(); }1 point