-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
I'm maybe going crazy, but on a install I'm working on since long time I have updated to latest dev. Now I have an empty "Session" on the setup menu. Missing process... Wasn't there a core module once for sessions? I can't find any Session modules. Also I'm looking for the Login Throttle module and can't find it anymore. What happened?
-
Maybe the example just isn't a very good one, as you don't know ahead if the repeater have any unchecked checkbox. $pa = $pages->find("template=basic-page, slides.count>0, slides.disable_slides=0"); foreach ($pa as $p) { foreach($p->slides->find('disable_slides=0') as $r) { echo "<p>$r->title</p>"; } } Should also work, not to loop pages that have no repeater that meet the criteria for nothing.
-
The term "selector" is the string you define to search, like in CSS or jQuery .someclass{} or $('.someclass') and not the result or the method "find()". I've read in some threads and now here (kongondo) (other than nesting the first selector inside the first foreach) and it can be confusing. Ok, find is your friend! Approaching it this way, with finding all pages with the repeaters, then loop all is all correct and required in this case, but seems like not so efficient to loop all repeaters just to find the not checked ones? Why not just use the wonderful search functions to get the repeaters not checked and then loop them? $pa = $pages->find("template=basic-page, slides.count>0"); foreach ($pa as $p) { foreach($p->slides->find('disable_slides=0') as $r) { echo "<p>$r->title</p>"; } }
-
This works as with your example, there's nothing wrong with it except that you need to add include=all: search and return all repeaters "slides" pages (internally have template "repeater_slides") with disable_slide not checked $slides = $pages->find("template=repeater_slides, disable_slide=0, include=all"); And it returns a PageArray So you can loop them out or whatever. foreach($slides as $slide) echo $slide->title; If you want to only get the repeaters from the page you're on this is almost same: $slides = $page->slides->find("disable_slide=0");
-
I just made another update to replace the fields settings with a AsmMultipleSelect for convenience. If you update, you want to select the textarea fields you want to use IM on. You also have to save the module setting at least once to make it work. And maybe reinstall the module to get rid of unnused settings, but not necessary.
-
It is working fine, make sure you updated the module with all its files correctly. The setting in the ModulesManager you talk about is now called: Textarea fields you want to use the ImagesManager. A button will appear above those fields. Add one or more fields separated by a pipe body|sidebar.
-
$pages->find('created<=yesterday')->first()-> parent()
-
I'm not sure the best way to check for multiple, it depends a lot on the fieldtype. It may differs from type to type. In case of a page field. You could try checking for the settings derefAsPage if($inputfield->derefAsPage == 0) { //... multiple } Or maybe... if($inputfield->value instanceof PageArray) { // .. multiple } Or simply by checking if the post value is an array. I'm not sure what the "PW way" means here. There's not so much the PW way, if it works... I personally would say yes, but being picky I wouldn't do it that way to begin with. But if it works out for you. To populate the fields again after submit, you just would add the value from the post to the inputfield before rendering. $field = $fields->get("$field_name"); $field->attr("value", $input->post->$field_name); echo $field->render(); // will have the value set Or you could use the processInput() of the inputfields to process and populate it. This is what PW uses to process fields. It doesn't matter what field type. $field = $fields->get("$field_name"); $field->processInput($input->post); // process field echo $field->render(); // will have the value set
-
If you can give me access to the installation, I can take a look.
-
Thanks enibas94 for the feedback and using my module. There's a permission for the module "images-manager". You can create a new permission with that name and give it to roles that should see ImagesManager page. There's currently no permission or access handling for the button added to all textarea fields. The "Textfields used for searching images on pages" is originally meant for the module to search for if there's images in the text. But kinda would be the same fields as where to add the ImagesManager button. So while already there, I changed the config to say "Textarea fields you want to use the ImagesManager on." So it is now used to define what textarea fields you want to use ImagesManager. This is now working for editor users. As for your error. Error message: Class 'PageImage' not found (line 526 of /../site/modules/ImagesManager/ImagesManager.module) Not sure but since the class name is "Pageimage" I guess it has to do with PHP version, because it works for me, but maybe the capital "I" in PageImage is making it not find the class on your environment. I changed it to "Pageimage" and committed an update. Can you let us know if it's working for you now?
-
A page field uses pages, so the array will contain the page id's. So you go through them and add them to the field. To make things easier with adding removing pages, you can just removeAll() and then add the selected values back. if($input->post->submit){ $page->of(false); $page->checkboxes->removeAll(); foreach($input->post->checkboxes as $pid) { $page->checkboxes->add((int) $pid); } $page->save(); } Edit: edited code a little
-
You need to set $brand not $page $brand->of(false) (Short version)
-
Ah now I can reproduce this. But I don't see a solution to this shortly, the image resizing and PW image plugin takes the window size to resize the image selected if original is bigger. There's so many parts involved and there's a lot of width height going on all over it's hard to track down. And it's not a bug but a more of a feature after all. If you select an image, you get presented with a resize dialog, if the image is scaled down, you'll see a "link to larger version (1200x800)" checkbox with the original image width. You can renter and set the width or height to the width and height inputs and then click insert image.
-
Can I have a 3d animation? :-D
-
And do you have image field setting max width set to 400? Was what Ryan asked.
-
Try 1:=option1
-
Also wanted to chime in and say wow! It could be almost coming from me Joke aside, I really thought about that the day Ryan implemented this, but never bothered as I'm not currently needing it. Really cool here's how it looks on my Teflon dev theme.
-
There's a bug in Functions.php I just filed a issue on github. I just tried to enter a module name that already is installed, and it checks beautifully for that and says it's installed but older version. This is meant to be a way to update the module too? I then hit download, but it felt wierd. It may would be cool then to have the title or message then say an update is available more clear? And the button called "Download v0.1.3 update" or something.
-
Take all my code and money too. Well the latter comes in form of code. Serious, I'm very proud to have played a role. I agree with what you said and will first go check it out and come back later...
-
Better image management / better integration with WYSIWYG
Soma replied to mindplay.dk's topic in Wishlist & Roadmap
BTW you guys know you can add predefined templates to TinyMCE that can be selected and inserted to fill in? Those are html templates and they can contain tags that will be replaced with current date, user name or anything. You even see the preview when selecting them from the dropdown. It's much like what Macrura posted just "better". -
Better image management / better integration with WYSIWYG
Soma replied to mindplay.dk's topic in Wishlist & Roadmap
I'm building something like block elements for processwire, it's just as with such system that they are complicated to do and often the system you implement them come to limit in terms of functionality or UI. If you are interested I could share the bare bone WIP proof of concept. We use a CMS at work for many years which allow such block system to build directly in the template that then is editable for the end user. You add a new block, select what type of block, and it will load the "template" with the field defined there. And so on, you can limit the count of the block, sort them and so on. Unfortunately the CMS has many flaws and is somewhat bloated and sometimes becomes a burden. It's as open as PW regarding what you build with it, I'd even go as far as saying it is a lot more flexible than PW. PW is just a lot more convenient to build structured data as is, simple and modular extendable and a lot more fun and reliable. If you want it's like Repeaters on steroids. This is what I originally imagined that repeater would be, but it came a little different. There were some people also discussed this when repeaters were introduced. Imagine Repeaters where you can select a "template" for each item. Each of them representing custom fields as many or different as you like. Those "templates" could be associated with a repeater. What I tried is to find a way to use the repeaters as a base for this and I think it would be possible to adapt them to work this way. Just a lot of work I then started building something from scratch just for fun that works like repeaters but only in the frontend. In the template you define the blocks you want to use for the repeater and it then will render a editable, sortable simple interface if logged in to manage block, and render them when not logged in. The block are pages saved unter a parent in the admin. There's no interface for the admin as this would go too far for now. You then could define a text field for a title and a textarea for the paragraph, and image with alignment, another with a video, another with a map etc. And if Wysiwyg used it would only to be able to set links, bold and such things as basic styling. This way you can get away from using a Wywiwyg as the main content editor and put everything in there which we have to agree is only as good as the editor, and we all know they can cause troubles. Rather than having building a complete new system with UI and not what for within a textarea or Wysiwyg, which would already exist if it would be a good way, I'd rather see the repeaters on steroids, for block based content easy to edit and build. -
A coincidence, hide it with a module http://processwire.com/talk/topic/3159-hide-settings-tab-in-page-edition/
-
Individual image-field widths (float / display inline)
Soma replied to dragan's topic in Wishlist & Roadmap
Its only needed in site admin templates. You dont need or should change anything in core. It willalso get overwritten on a update.- 9 replies
-
- imagefield
- image field
-
(and 1 more)
Tagged with:
-
A coincidence http://processwire.com/talk/topic/3919-individual-image-field-widths-float-display-inline/
-
Testing this again, I got the latest dev again with the session login throttle fix, and can't really say now what version it was and in what case. I only got it once after trying to login (custom login) when there's was a throttle of 10 seconds going. It would throw me the has() on a non object in user.php. But somehow it's gone in the dev. Since in stable 2.3 the session login throttle is now still broken, do you consider fixing it there too because it's an quite important feature security wise.