Leaderboard
Popular Content
Showing content with the highest reputation on 02/03/2015 in all areas
-
Just crafted PayPal module also: https://github.com/apeisa/PaymentPaypal5 points
-
Adrian, You are a machine! I don't know how you manage to answer things so fast. You are everywhere! Excellent job, I'm consistently impressed and how quickly and thoroughly you respond.5 points
-
Ok, i can confirm that ProcessWire does work on NGINX and HHVM (no traditional caching being used atm), normal page load times are around 1.5 seconds according to Chromes network inspector. Setup is as follows: install NGINX as normal, and HHVM from hhvm.com I've edited the /etc/hhvm/server.ini file to make HHVM run on port 9001 so i can run it along side PHP-FPM on port 9000 HHVM will create a hhvm.conf file in your NGINX directory. edit this conf to point hhvm's relevant port number. location ~ \.(hh|php)$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } Then in your NGINX sites-available edit the file to route URLS to ?it= location / { try_files $uri $uri/ /index.php?it=$uri&$args; } Then include the hhvm.conf to handle the PHP processing. include hhvm.conf; Restart both HHVM and NGINX and it should be running just fine, with the option to switch back to PHP-FPM if needed. Hope this helps, setup seems to be pretty quick!4 points
-
Here is very simple abstract class that I hope would get ideas and contribution from community, so that different PW projects could use same payments methods in generic way: https://github.com/apeisa/Payment Currently Payment modules just assume it's found from /site/modules/Payment/Payment.php, but I would love to get it autoloaded somehow (I went with PW module dependencies and transformed the base class into PW module also). Also I have tried to keep this as minimum as possible - hopefully I have not left anything too important out. I have also created one two payment modules, that use this base class: https://github.com/apeisa/PaymentStripe/ https://github.com/apeisa/PaymentPaypal/ Please visit their repos for examples.3 points
-
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 Pro3 points
-
using that would have required using html files; where with the way my docs 'system' works, it is all being done with pages, so users can add and modify existing docs, links docs by template or page.. much easier!3 points
-
Is this custom page attached to a process module? In that case you simply assign a new permission to the process in the module's config, eg: public static function getModuleInfo() { return array( 'title' => "My Process Module, 'permission' => 'special_permission', ); } That will limit access and viewing to those roles with that new "special_permission" permission. Does that take care of your needs? If it doesn't have its own process, please explain a little better what this page does, how it was created etc.3 points
-
Ok "page” doesn't work but "page.id" selector: parent=page.id Gives you children of edited page.2 points
-
Your code is probably implemented into another php file so this would look something like this: <?php // Modules include <div class="…"><!-- Your HTML --></div> This would cause an error without the closing ?> and it would makes sense not to expect everybody to open a php hanna code with <?php .2 points
-
You need to echo the html markup within your outer php tags as strings. Or you can probably just get rid of the outer php tags. <?php echo '<div class="row fullWidth img">'; echo ' <img src="' . $config->urls->templates . 'img/header.jpg" alt="header-picture">'; echo '</div>'; ?> <!-- OR simply: --> ?> //just a closing tag here <div class="row fullWidth img"> <img src="<?php echo $config->urls->templates; ?>img/header.jpg" alt="header-picture"> </div>2 points
-
Seems like you've chosen the wrong type of hanna code. It contains php, so you need to choose php as type not html. Html code will be plain inserted and not compiled by php, that's why it's landing directly in the source code. A small thing I noticed. // why the $body variable if you're not using it? <?php $body = $page->body; echo $page->body; ?> // this does the same thing <?php echo $page->body; ?>2 points
-
Thanks for this module. I use smart fields and got a little bit trouble using the description field. Because I chose fields which include html tags. Even if if I check "Strip Tags" in the field settings for seo_description. I guess that this setting doesn't take effect if the field was left blank. This results in: <meta name="og:description" content="<h2>KF Interactive GmbH</h2> <p> D-04107 Leipzig</p> <p>Tel.: +<br /> Fax: +<br /> Mail: <a href=" mailto:info@kf-interactive.com"=""> <p><strong>Konzeption und Gestaltung der Website:</strong><br> <a href=""></a> & KF Interactive</p> "> .. and breaks the layout. I changed line 206: - $pageData['description'] = $page->get(implode('|', $configData['descriptionSmart'])); + $pageData['description'] = strip_tags($page->get(implode('|', $configData['descriptionSmart']))); .. and everything works Maybe you could include this litte fix in a later version?2 points
-
2 points
-
Check out the new feature Ryan just committed to dev - on the field's new Action tab you can "Send fields to templates". Then on the next screen you get to order their positions on each of the templates they were just assigned to - pretty cool!2 points
-
FieldtypeFontIconPicker Supported Icon Libraries FontAwesome 4.7.0 Uikit 3.0.34 IonicIcons 2.0.1 Cahangelog NOTE: Module store data without prefix, you need to add "prefix" when you want to show your icon on front-end, because some of front-end frameworks using font-awesome with different "prefix". Module will search site/modules/**/configs/IconPicker.*.php and site/templates/IconPicker.*.php paths for FieldtypeFontIconPicker config files. All config files need to return a PHP ARRAY like examples. Example config file : create your own icon set. File location is site/configs/IconPicker.example.php <?php namespace ProcessWire; /** * IconPicker : Custom Icons */ return [ "name" => "my-custom-icons", "title" => "My Custom Icon Set", "version" => "1.0.0", "styles" => array( wire("config")->urls->templates . "dist/css/my-custom-icons.css" ), "scripts" => array( wire("config")->urls->templates . "dist/js/my-custom-icons.js" ), "categorized" => true, "attributes" => array(), "icons" => array( "brand-icons" => array( "title" => "Brand Icons", "icons" => array( "google", "facebook", "twitter", "instagram" ) ), "flag-icons" => array( "title" => "Flag Icons", "icons" => array( "tr", "gb", "us", "it", "de", "nl", "fr" ) ) ) ]; Example config file : use existing and extend it. File location is site/configs/IconPicker.altivebir.php <?php namespace ProcessWire; /** * IconPicker : Existing & Extend */ $resource = include wire("config")->paths->siteModules . "FieldtypeFontIconPicker/configs/IconPicker.uikit.php"; $url = wire("config")->urls->templates . "dist"; $resource["scripts"] = array_merge($resource["scripts"], ["{$url}/js/Altivebir.Icon.min.js"]); $resource["icons"]["flag-icons"] = [ "title" => "Flag Icons", "icons" => array("tr", "en", "fr", "us", "it", "de") ]; $resource["icons"]["brand-icons"]["icons"] = array_merge($resource["icons"]["brand-icons"]["icons"], array( "altivebir" )); return $resource; After you add your custom config file, you will see your config file on library select box. Library Title (Location Folder Name). If your library categorized and if you have categorized icons set like uikit and fontawesome libraries, you will have category limitation options per icon field or leave it empty for allow all categories (default). Example : output if ($icon = $page->get("iconField")) { echo "<i class='prefix-{$icon}' />"; } MarkupFontIconPicker Usage // MarkupFontIconPicker::render(YourIconField=string, Options=array) echo MarkupFontIconPicker::render($page->YourIconField, [ 'prefix' => 'uk-icon-', // Icon class prefix, if you have different prefix, default is : "fa fa-" 'tag' => 'span', // Icon tag default is : "i" 'class' => 'fa-lg', // If you have extra cutom classes, for example : icons sizes, Array or Sting value 'style' => 'your custom styles if you have' // Array or String Value ]); Theme support Search support Category support1 point
-
Not specificly related to PW, but in a way it does. I have setup two processwire installs on different sub-domains. Scenario: 1. Main website - visitors go here http://www.domain.com/ 2. Data API provider - RESTful API spitting out (cached) JSON objects http://data.domain.com/ Website 1 loads data trough AJAX / Angular.js from website 2 Since PW by default has the following line in the .htaccess file it will prevent access from cross domains requests that load in an iframe Header always append X-Frame-Options SAMEORIGIN One solution i found was to put the following line in my template file (or somekind of init.php file) at website 2, allowing website 1 to access header('Access-Control-Allow-Origin: http://www.domain.com'); That worked nice, until i installed the Procache module from Ryan. A logic change, since PHP is completely bypassed it does'nt set the headers anymore. The final solution: I removed the header line from the php file and put it in the .htaccess file just below the SAMEORIGIN line on website 2 Header always append X-Frame-Options SAMEORIGIN Header set Access-Control-Allow-Origin: "http://www.domain.com" Could be helpful to anybody, thats why i posted it here Update: found a nice script allowing any sub-domain of the origin host http://stackoverflow.com/a/195196901 point
-
This might sound like i'm stupid, but bare in mind i'm 80% front end dev. Now I know PW works on hooks, but is it possible to use MVC structure when building plugins?? In a way i'm just curious as to the general architecture of PW and what's possible. ( in the sense of can i grab some MVC built functionality elsewhere and plug it into ProcessWire? ) Any help getting my head around this would be great1 point
-
Doing a refresh in the modules section should be enough to get permissions working.1 point
-
@netcarver I ordered the Pi2, as soon as it arrives I'll do it.1 point
-
What input type are you using? PageListSelect won’t allow custom selectors or custom PHP code. The Autocomplete input type doesn’t support custom code either. If you put return $page->children; as the custom php, it should totally work.1 point
-
I think your best option would be to modify this module: https://github.com/Hani79/Processwire_FieldType_Templates It is for selecting templates but could be easily converted to work for fields - let us know if you need any help converting, or if you do it, please share it here!1 point
-
probably I confused a bit but yes it's a problem of access...I'll figure something else for this edit: oh easy, I just granted access "view" to user template to a specific role, now it's working, thanks Soma1 point
-
I'm not even sure I understand the what where and how. But I'm sure if a user has no access to user template or roles you can't filter with subfields. I recognized this in ListerPro too. Edit: Also, "I tried" doesn't say anything to me.1 point
-
1 point
-
I just extended the functionality of this great module. I had the need to still allow some pages to be accessible in active maintenance mode. I submitted a pull request in github for this module and hope it gets accepted (just learning module programming)...1 point
-
I've encountered an interesting problem when using AIOM recently - but also have a potential fix, so it's not all bad. Here's the information! I am using separate IE and non-IE stylesheets, with each loaded via conditional comments in the markup. There are two arrays for the files: $config->css->all = array( 'css/pure-min.css', 'css/grids-responsive-min.css', 'css/fa/css/font-awesome.min.css', 'css/cds-all.css', ); $config->css->oldie = array( 'css/pure-min.css', 'css/grids-responsive-old-ie-min.css', 'css/fa/css/font-awesome.min.css', 'css/cds-oldie.css', ); These get minified in the template: <!--[if lte IE 8]> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS($config->css->oldie); ?>"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS($config->css->all); ?>"> <!--<![endif]-->That is all great. The problem arises when the source files all have the same modification time - which it does on the live environment of this website, and when using an automated deployment service.Because each list of files has the same number of files, and the files have the same modification time, the generated cache name is always the same, and one overwrites the other. My fix was to include the file's paths when generating the cache name in _getCacheName: foreach ($files as $file) { $_timestamp .= $file['absolute_path'] . $file['last_modified']; } I'm more than happy to create a pull request on GitHub for this, but thought it'd be worth mentioning/discussing first1 point
-
I updated my post above. Apparently you need a closing php tag at the top, so it doesn’t expect php code. Disclaimer: I have only tested this with a PW and module version from about a year ago.1 point
-
Solved Insteed of this code: $pui = $pages->get("/users/$display_name/UserInfo"); foreach($pui->userInfo as $info) { $info->of(false); $info->set("firstName", $first_name); $info->set("lastName", $last_name); $info->set("displayName", $display_name); $info->set("dateCreated", date("j F Y H:i:s")); $info->set("dateUpdated", date("j F Y H:i:s")); $info->set("email", $email); $info->save(); $info->of(true); } I put this: $p = $pages->get("/users/$display_name/UserInfo"); $p->of(false); $pui = $p->userInfo->getNew(); $pui->firstName = $first_name; $pui->lastName = $last_name; $pui->displayName = $display_name; $pui->dateCreated = date("j F Y H:i:s"); $pui->dateUpdated = date("j F Y H:i:s"); $pui->email = $email; $p->save(); Also, I added this code at the end of IF statement to auto login user after registration: if($session->login($display_name, $password)) $session->redirect("./"); I found out that if user put "eee@eee" as a email adress, form is passed successfully but email repeater field remain empty. I need to stop registration process with an error warning (user can change it during a reg. process) or accept that kind of email (so user can change it later). How to handle this? Cheers!1 point
-
Hey Pete, thanks for your hint! I added the module to the repository! Best regards, Martin1 point
-
Posting this here as I'm using 2.5.17. If I go to save (I'm not cloning it) a PageTable field I get this error: Unable to clone field because name "" is already in use or is a reserved name.1 point
-
Hey Adrian, thanks four your reply. For sure I can share the migration script! I'm working on a project right now where I have to deal with much more files and images so I think sooner or later my script will take care of files and add them to the regular PW files folder. At the moment I am quite busy so that it'll be impossible for me to adapt my script for your Migrator module. But as soon as I am working on my migrator script again I definitivly will take a look at yours and I'll check if there's a way to connect both - or just improve mine If you want to I can share my status quo Cheers1 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
-
Hi there If you could add your module to the Modules Directory I can add the relevant badge to your profile in the Developer Directory1 point
-
@mr-fan, using PW pages for the docs, not html files; and then this module pulls them into the docs tab: https://gist.github.com/outflux3/3e76a1338b61d708157c posted also more here.. https://processwire.com/talk/topic/8392-simple-built-in-docs/?p=868131 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
-
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...1 point
-
1 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
-
1 point
-
This week's dev branch updates include a new Fieldtype (FieldtypeOptions): https://processwire.com/blog/posts/new-options-fieldtype-processwire-2.5.17/ (blog post about it) and documentation https://processwire.com/api/modules/select-options-fieldtype/1 point
-
I would imagine something more like this, where one could drag and drop from the fields list to the templates. The fields are only there as list to choose from. Click on the title could open a modal edit. Maybe two buttons on the bottom, to add Fields / Templates to it. Edit: It's just so cool to have this mockup build faster than I could have in some design software.1 point
-
A quick update. Not adding image variations to the $valid array will get them removed. Although this includes variations that are still in use, these will be created again dynamically on the next page view. This is acceptable for me as I am using ProCache. As an example of the result, here is again the folder from above: 1) AFTER running the script with $valid[] = $f-basename commented out, but BEFORE page view: 19 images: 9 original size images 9 auto created "0x100" images 1 image I am not sure why it is there) 2) AFTER running the script and AFTER a page view: 37 images: 19 images from above: 9 thumbnails 9 PIM images with watermark Cheers, Stefan1 point
-
Hi @a.masca and welcome to the forums. Don't mess around with Hanna for videos: http://modules.processwire.com/modules/textformatter-video-embed/ And this for google maps: http://modules.processwire.com/modules/textformatter-google-maps/1 point
-
Is it only the repeater fields that don't save, or all the fields? I'm assuming all fields, but let me know if I'm wrong. Because you are doing this outside of ProcessPageEdit, you need to connect the values from your inputfields to the values in your page. Something like this: function formToPage(InputfieldWrapper $form, Page $page) { foreach($form as $inputfield) { $name = $inputfield->attr('name'); if($name && $inputfield->isChanged()) { $page->set($name, $inputfield->attr('value')); } if($inputfield instanceof InputfieldWrapper && count($inputfield->getChildren())) { formToPage($inputfield, $page); // go recursive } } } formToPage($form, $page); $page->save();1 point