-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Ryan, so showing or hiding a repeater isn't supported? I'm NOT using dependecies in the repeater but to show/hide the complete repeater. Again, I have this setup, with a checkbox to toggle a fieldset and a repeater (also a fieldset no?) I have a simple checkbox checked : show repeater / hide other fieldset unchecked: hide repeater / show other fieldset Multilanguage installed. Repeater has also multilanguage title. But I don't think it has to do this it. Can anybody reproduce this pls? Lately anything I report, Ryan doesn't seem to be able to reproduce. :/ ---- Required option: The required option for a repeater field was always there, it has nothing to do with dependencies. But it doesn't work with them to set a repeater required.
-
While this technic is nice to know it is much easier to enable compression via .htaccess, also because of the reason Ryan mentions. I don't see any reason why to do this via PHP. See the H5BP htaccess for nice technic https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L379 and other goodies. Also only while the html served might be 4kb instead of 24kb, this doesn't make the page load that much faster, but using this for all resources along with caching headers you get a ~30% decrease of file sizes. Using PW template cache can have the most impact on page loading, depending on how render intensive the page is, you get a loading time around factor 2-5 times faster just because it doesn't need to render it.
-
I get strange behaviors when using a checkbox to show/hide a repeater field it seems very buggy. I try a setup like: Checkbox on : show repeater / hide other fieldset off: hide repeater / show other fieldset Inititially it works fine, but as soon as I created a repeater and delete it again, then save. The toggle with the checkbox doesn't hide the repeater anymore. I need to save it again with checkbox unchecked, but doesn't matter what it just is completly messed up. ---- Maybe not related: Additionally I recognized something, I have repeater with and a title field language (title is required), and sometime when saving and not filling in title (required) I get this notice Notice: Trying to get property of non-object in /home/www-data/mittendrin.update.ch/wire/modules/LanguageSupport/LanguageSupport.module on line 209 Notice: Trying to get property of non-object in /home/www-data/mittendrin.update.ch/wire/modules/LanguageSupport/LanguageSupport.module on line 209 Notice: Trying to get property of non-object in /home/www-data/mittendrin.update.ch/wire/modules/LanguageSupport/LanguageSupport.module on line 209 Notice: Trying to get property of non-object in /home/www-data/mittendrin.update.ch/wire/modules/LanguageSupport/LanguageSupportFields.module on line 131 Which is a notice, ok, but the strange thing is that the repeater title language suddenly doesn't have languages fields anymore, just one title text field. The repeater has 3 ready pages. And also maybe you already know but "required" doesn't work with repeater, but the option is there, but maybe it's because of dependencies?
-
Just to clarify, in prev version 1.2 the code you posted works just fine. But it changed in 1.2 and route is a module.
-
You need to load the route module additionally to angular.js http://code.angularjs.org/1.2.0rc1/ <script src="http://code.angularjs.org/1.2.0rc1/angular.js"></script> <script src="http://code.angularjs.org/1.2.0rc1/angular-route.js"></script> <script src="js/app.js"></script> app.js angular.module('phonecat', ['ngRoute']). config(['$routeProvider', function($routeProvider) { $routeProvider. when('/phones', {templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl}). when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}). otherwise({redirectTo: '/phones'}); }]); where partials/phone-list.html could also be a PW page url with a partials template with url segments enabled create a page: /partials/ then the route configured like: /partials/phone-list and in the template file if($input->urlSegment1 == "phone-list"){ echo "<div>your partial template ... </div>"; }
-
Install db session module and you'll have a setup page with users. (not installed in core)
-
$time = Debug::timer(); echo Debug::timer($time); and my ChromePhpLogger ? module
-
You maybe wan't to look into the debug.inc that comes with the admin theme /wire/templates-admin/debug.inc and counting queries is kinda pointless, the type of queries are important.
-
If you create a template divider and place the page it in the tree you could do: function hookGetListClass($event){ $child = $event->arguments("page"); if($child->template == "divider"){ $event->return = " divider"; } } $options = array( 'xtemplates' => 'divider', 'xitem_tpl' => '' ); $nav->addHookAfter("getListClass", null, "hookGetListClass"); echo $nav->render($options); Create as many divider pages as you like and name them "-------------------------------------------"
-
Hello it's me again! Ok, I now maybe lost already days with this... and loosing my mind slowly... and seen so many problems and error that I think has to do with the language support in general. It shows there definately some hard to track and explain "bugs" or miss-behaviors of the system. I thought it is all very easy but turns out it is not at all, or I am just not made for this. As I'm said I'm trying to import many data from another system to multilanguage pages in PW in step by step each language. Newest thing was that images got added twice to fields, when there's only one and only one save happens before and after. After long time I found it has to do with language and user somehow again! I then found that by $pages->uncacheAll() after the save it works again. That's cool but I have no idea why. A test on a simple script to create a page and add an image works fine, just not in the script I build which is quite complex already. I have to manually set the user language after each save and somehow it screws up a lot due to not understanding what's happening. Depending on if you're on default or alternative language the behaviour is different as we already found out. Now I was removing the workaround of setting user language after saving because I'm already working on default language, and suddenly I get this: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_title.data1011' in 'where clause'' in /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/DatabaseQuery.php:86 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/DatabaseQuery.php(86): PDOStatement->execute() #1 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/PageFinder.php(146): DatabaseQuery->execute() #2 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/Pages.php(143): PageFinder->find(Object(Selectors), Array) #3 [internal function]: Pages->___find('has_parent=4349...', Array) #4 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/Wire.php(359): call_user_func_array(Array, Array) #5 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/Wire.php(317): Wire->runHooks('find', Array) #6 [internal function]: Wire->__call('find', Array) #7 /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/Page.php(862): Pages->find('has_parent=4349...', Array) #8 in /Applications/XAMPP/xamppfiles/htdocs/blank.ch/wire/core/DatabaseQuery.php on line 86 Seriously PW seems to now look to a title language field of the default data field_title.data1011 : the default language is 1011 and the title in the default language is field_title.data and not field_title.data1011. Just as a pointer to others maybe trying to create a multilanguage site imported and created via a script/bootstrap, DON'T as you will regret it as long as those bugs are still in there. Ok ... breath slowly Soma ...
-
how-to get a list of all pages (recursiv) without admin-pages?
Soma replied to Stefan G. Eberl's topic in API & Templates
This turns out more complex than it seems, but it is usually something not used that often or ever at all. Even with my experience took some time to get all pages, unpublished , published, hidden, not in trash and not under admin. This is with superuser logged in as I think as editor or guest user you won't get pages from trash anyway. But something like this is needed currently Unless I'm missing something. $pa = $pages->find("has_parent!=2,id!=2|7,status<".Page::statusTrash.",include=all"); foreach ($pa as $p) { echo "<li>$p->path</li>"; } Note that as soon as you got a few hundred or thousand pages you will get a problem Edit: id = 2 // is the /processwire/ admin parent id = 7 // is the trash include=all // to get all pages unpublished and hidden -
Just added support for per level and page field/property custom selector in MarkupSimpleNavigation: http://t.co/mYV17OFq0R #processwire
-
You're welcome. Now after you know how to do it manually you're allowed to forget about it. I'm not exactly sure I would have thought of doing it like this before as I think I was often overcomplicating. Often it just takes some time to get to convenient solutions, I hope it's something useful. A lot of flexibility is gained regarding defining/excluding different branches or levels in a simple manner.
-
Oky doky. v 1.2.1 # added support for nav_selector property/field and selector_leveln (new in 1.2.1) You can now add a special property "nav_selector' to page(s) to define custom selector for rendering their children. This can be done on runtime or via a custom field added to pages to remotely control the selector. You can configure the name of the field by using the newly added option "selector_field". MarkupSimpleNavigation will look out for it and use it, otherwise it will use the "selector" option. You can now define selector on a per level basis. Simply use the _leveln suffix on the "selector" option, where n is the level number from the root parent. This is best illustrated by the following example: $pages->get(1001)->my_selector = "template=projects"; $options = array( "selector_level1" => "template=ressort", "selector_level2" => "start=0, limit=10", "selector_level3" => "template=news|events, sort=-created", "selector_field" => "my_selector" ); echo $nav->render($options); Note that "my_selector" has priority and will overwrite any other selctor or selector_leveln https://github.com/somatonic/MarkupSimpleNavigation
-
I'm currently playing around a little and I might have a very elegant solution that you could: 1. Give a page or pages a "$page->selector" on runtime that the module will look for. So you could specify on every page what children selector it will have. This could then even work if you create a special field to attach to templates to make it configurable in the admin. $pages->get(1001)->selector = "start=0,limit=10"; 2. and have selector options "selector_leveln" that you could (dynamicly unlimited) use and the module will look for it, if found use that instead of the $options['selector'] "selector_level1" => "start=0,limit=10"; "selector_level2" => "start=0,limit=20"; All quite simple to implement and seems very powerful. How does that sound?
-
No this is not supported. I'm not sure this is something we need very often.
-
So I'm not sure how much of a problem of language support names is or a general problem with languages.
-
Ryan, I'm back again withe the user language again when saving a page. I'm currently working on importing a large site in 3 languages. Now I scripting a bootstrap to import the data and create pages. Now when doing the second language I recognized that the user language is set back to default after saving a page. I figured the LanguageSupportPageNames wouldn't even get loaded (eventhough it's autoload) and the code to set the user language after save doesn't get called. I put code in there (exit()) to see and nothing. Maybe just the after save hook doesn't get called but it's strange. So I have to again manually set the language back to the alternative after every save.
-
Add start=0 to your selector.
-
Looks like you got problems with uploading files as they're clearly not missing.
-
Welcome to the age of google search http://processwire.com/talk/topic/4309-no-css-rendering-in-admin/ http://processwire.com/talk/topic/1374-upload-file-fails-if-over-128kb-yet-phpini-looks-right/
- 4 replies
-
- mod_rewrite
- Apache
-
(and 3 more)
Tagged with:
-
Also what I wanted to ask is, if the other icons show correct or only the trash icon is missing?
-
I think more that the problem maybe on your side but can't say as it works for me and looks like for others too. The image you're referring to is fine and loading correct from the jquery ui css.
-
It shows for me in all Browsers here, works fine.
-
Thanks. I never experienced this and not sure whats about it. I used it a long time and also many clients. What browser and which version theme?. I would also recommend using the dev version of teflon.