-
Posts
212 -
Joined
-
Last visited
Everything posted by Roope
-
Thanks for your reply Pete! Site Profile Exporter makes a sql-dump from the site setup so what's wrong with the current? You still need to replace original install.sql file before install and replace possible needed modules/templates etc. manually so installation is all the same.
- 5 replies
-
- HTML5
- Boilerplate
-
(and 1 more)
Tagged with:
-
Hello everyone! While there was couple of tryouts at the moment, I think PW was lacking decent HTML5 Boilerplate integration so here's a attempt to fix that. HTML5 Boilerplate for ProcessWire I took default install dump and stripped it down to bare minimum so it only includes data for Home and 404 pages + Title and Body fields. https://github.com/BlowbackDesign/PW-H5BP/blob/master/site-default/install/install.sql Default templates folder is modified so that head.inc and foot.inc contain basic HTML5-structure from H5BP and new 404.php is added for 404 page so that it matches H5BPs 404.html page (new redesigned version). Indents are switched from spaces to tabs and all elements are self closed - mostly out of personal preference. https://github.com/BlowbackDesign/PW-H5BP/tree/master/site-default/templates PW-H5BP is based on current master branch so it's little ahead of v4.3.0. Idea is to keep PW-H5BP up to date with releases of HTML5 Boilerplate.
- 5 replies
-
- 6
-
- HTML5
- Boilerplate
-
(and 1 more)
Tagged with:
-
Any news about the date for meetup or are we waiting for more participants?
-
Hide Process Module custom admin pages for certain role
Roope replied to Roope's topic in General Support
Yep, my explanations in finnish are usually terrible and worse at english so it can be hard in both ends Then to another problem with this case. There is 'item' template with no access settings but noticed that when I log in as non superuser it throws me error when creating new page. User can still edit existing page with no problems. Just updated core from dev to 2.4.1 but no change. Permissions for sales role at item page (parent has same): page-view page-edit page-delete page-move page-create page-add Error: TemplateFile: You don't have access to the template required to add pages here #0 [internal function]: ProcessPageAdd->___execute() #1 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #2 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #3 /Users/Roope/Sites/demo/wire/core/ProcessController.php(196): Wire->__call('execute', Array) #4 /Users/Roope/Sites/demo/wire/core/ProcessController.php(196): ProcessPageAdd->execute() #5 [internal function]: ProcessController->___execute() #6 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #7 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #8 /Users/Roope/Sites/demo/wire/core/admin.php(64): Wire->__call('execute', Array) #9 /Users/Roope/Sites/demo/wire/core/admin.php(64): ProcessController->execute() #10 /Users/Roope/Sites/demo/wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/Users/Roope/Si...') #11 /Users/Roope/Sites/demo/site/templates/admin.php(24): require('/Users/Roope/Si...') #12 /Users/Roope/Sites/demo/wire/core/TemplateFile.php(140): require('/Users/Roope/Si...') #13 [internal function]: TemplateFile->___render() #14 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #15 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('render', Array) #16 /Users/Roope/Sites/demo/wire/modules/PageRender.module(337): Wire->__call('render', Array) #17 /Users/Roope/Sites/demo/wire/modules/PageRender.module(337): TemplateFile->render() #18 [internal function]: PageRender->___renderPage(Object(HookEvent)) #19 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #20 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('renderPage', Array) #21 /Users/Roope/Sites/demo/wire/core/Wire.php(381): Wire->__call('renderPage', Array) #22 /Users/Roope/Sites/demo/wire/core/Wire.php(381): PageRender->renderPage(Object(HookEvent)) #23 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('render', Array) #24 /Users/Roope/Sites/demo/wire/modules/Process/ProcessPageView.module(152): Wire->__call('render', Array) #25 /Users/Roope/Sites/demo/wire/modules/Process/ProcessPageView.module(152): Page->render() #26 [internal function]: ProcessPageView->___execute() #27 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #28 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #29 /Users/Roope/Sites/demo/index.php(194): Wire->__call('execute', Array) #30 /Users/Roope/Sites/demo/index.php(194): ProcessPageView->execute() #31 {main} EDIT: I can fix this if I set page permissions manually but when set 'No' only superuser is able to add new 'item' pages. -
Hide Process Module custom admin pages for certain role
Roope replied to Roope's topic in General Support
I was playing with Ryans Page Edit Per User but totally missed this one.. Thanks kongondo! Actually this wasn't even needed since now that custom admin pages are process modules, I can create permission for each and use that with role to limit access. Works very nice. -
I have three roles for admin users (admin, sales, billing) and all of them have custom admin process page under /admin/. I'd like to limit page view permisions so that 'sales' couldn't see custom admin page for role 'billing'. This could be done easily by using diogos Admin Custom Pages Module but it's not compatible with new admin theme and has some another disadvantages compared to straight Process Module approach. Is there any way to control $page->viewable() per role even if pages share the same template? Thanks for any help!
-
This sounds awesome! The location couldn't be better - you can count me in anytime.
-
Almost one year later I'm happy to say that I finally got this autocomplete feature implemented to exclude pages option. Also forced mailto links can now be disabled from module config. Version got bumped to 1.0.2. This also means that our love and relationship with PW is soon having it's first birthday. What a year! Still having butterflies in stomach.
-
Thanks Wanze! Lighting fast response and perfect answer! This is multilingual site and I had finnish language by default for admin user so change back to english corrected output. You rock! But now this leads to another question. I don't want my css output change for user language. It has to be same all the time or it's not valid. How can I prevent this change? EDIT: ..or that makes me wonder isn't this more of a issue at oyejorges less class since it should worry about generating valid css and not to rely on any php locale settings..
-
Hi all! I came across to strange issue today. I was testing the oyejorges Less.php class to parse my less assets and noticed that when I use it on PW template the output of class changes. When you use less percentage() function, on PW decimal mark changes from point to comma. I've been using oyejorges Less.php class for some time now on different php apps and haven't noticed this kind of behaviour before. I'm totally lost here - where is it comming from and is it because of PW or Less.php? Any help is much appreciated! https://github.com/oyejorge/less.php/search?q=percentage&ref=cmdform https://github.com/oyejorge/less.php/search?q=Less_Tree_Dimension&ref=cmdform My RTC details - code on php file outside PW and on PW template. template: <?php require 'site/modules/less/Less.php'; // test.php require '../modules/less/Less.php'; // site/templates/home.php $less = new Less_Parser(); $less->parse(" div { value: percentage(12.3 / 14.5); } "); echo $less->getCss(); ?> output: div { value: 84.82758620689656%; } // test.php div { value: 84,82758620689656%; } // site/templates/home.php
-
Required only if... and conditions with Pages field
Roope replied to Roope's topic in General Support
Hello! I just downloaded last dev branch and noticed that this issue still exists. I have project that needs this kind of functionality so I'd like to know is there any other way to validate fields manually by module? Case is that when page dropdown (Pages field) has certain value set, some fields are needed to be required. At the moment this is not possible with field required if settings. -
Extract Content From Repeater to another page?
Roope replied to quickjeff's topic in General Support
You can use same find method that diogo posted: $featured = $page->band_performance->find("limit=5"); Or you can use slice method to get number of results you need: $featured = $page->band_performance->slice(0,5); http://cheatsheet.processwire.com/#pagearray-wirearray -
Yep, sorry.. Path selector always begins with slash. I'll fix my example. You could also use page id or any other valid selector.
-
I think that it has something to do with (page name) language support. Now your search form points to http://creacc.espaceproduction.com/rechercher/ but because of lang support page actually lives in lang prefixed url http://creacc.espaceproduction.com/fr/rechercher/. Now PW does redirect and thus loses the search query. You could try something like this: <form id='search_form' action='<?php echo $pages->get("/rechercher/")->url; ?>' method='get'> <input type='text' name='q' id='search_query' value='<?php echo htmlentities($input->whitelist('q'), ENT_QUOTES, 'UTF-8'); ?>' /> <button type='submit' id='search_submit'>Rechercher</button> </form>
-
@diogo, just for the record, I noticed that throw new Wire404Exception() also gets empty TemplateFile: error and does not work as expected.
-
Required only if... and conditions with Pages field
Roope replied to Roope's topic in General Support
Thanks for reply Ryan! Unfortunately it's still there. Just tried out latest dev (329388108d5ab0ebe9439cbf7c40be5387d03113). -
OK, thanks for your help! Much appreciated. Segments must be unsuported in admin then.
-
Admin Templates and Fields looks to have edit url segment.
-
True, and sorry. Just made a quick assumption here.. Well, I'm totally fine with get if there is some limitation to url segments in admin. I'm sure Ryan will clarify us on this one.
-
Isn't /page/ and /page/add/ just url segments in admin?
-
Hello diogo, thanks for great module! Has anybody used this with url segments? I tried but noticed some bug on latest dev. It throws TemplateFile: Unrecognized path error notice when there is some url segment in use. Not any content from template file.
-
Required only if... and conditions with Pages field
Roope replied to Roope's topic in General Support
I'm talkin about field settings at admin setup. Here's my price_sold field input tab (one example I tried to describe earlier): And here what's going on when I edit page using these fields: -
Hello everyone! Little support needed with required only if rules. On latest dev I have a setup with fields price_sold (float) and sold_user (page). I want price_sold to be required if sold_user has some data. If I set condition to sold_user!='' required asterix appends next to price_sold label but I can still save page normally with empty field. If I set sold_user='' there is "Missing required value (price_sold)" error on every save - is sold_user empty or not. Also same with sold_user.count=0/1. Can it be some bug with language modules? Or am I just reading the docs wrong? http://processwire.com/api/selectors/inputfield-dependencies/#example-blank http://processwire.com/api/selectors/inputfield-dependencies/#example-page
-
OK, had some time to get hands dirty and here's what came up: module init: public function init() { $this->addHookAfter('ProcessPageAdd::buildForm', $this, 'newItem'); } function to prefill values on new items: public function newItem(HookEvent $event) { // get parent page $parent = wire('pages')->get((int)$_GET['parent_id']); // continue only if new item page if ($parent->template->name != 'items') return; // hook to page inputfields $this->addHookBefore('Inputfield::render', function($event) { $field = $event->object; // current field $fields = array('title','_pw_page_name'); // fields to modify if (in_array($field->name, $fields) && empty($field->value)) { $field->set('value', 'some_val'); } }); } Looks much better now - doesn't it?
- 23 replies
-
- 1
-
- page
- after saving
-
(and 1 more)
Tagged with:
-
Muchas gracias Ryan! I'm just bit lost how to continue from here.. How can I get fields from this specific form: public function createItem(HookEvent $event) { $form = $event->object; die(var_dump($form->fields)); } I get data from all existing fields. I've also tried: // to get from $form = $event->object; $form = $event->arguments(0); // to get fields $fields = $form->getInputfieldsForm(); $fields = $form->processor()->getInputfieldsForm();
- 23 replies
-
- page
- after saving
-
(and 1 more)
Tagged with: