Jump to content

Alfred

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Alfred

  1. Making small steps with programming in ProcessWire. But thanks to guys like you (and Processwire itself of course) all the small steps take me further than I ever thought possible. Thanks again and have a nice weekend.
  2. Thanks Adrian, I was just writing the solution to my own question. In the thread I mentioned I found out that there was a little typo that made it not work. Your suggested code works, thank you. Could it be though that it is not working for the title field. It is gives an error: Notice: Indirect modification of overloaded property ProcessWire\InputfieldWrapper::$title has no effect in /…/…/…/htdocs/…/…/processwire/site/modules/HideFields.module on line 27 Warning: Attempt to assign property of non-object in /…/…/…/htdocs/…/…/processwire/site/modules/HideFields.module on line 27 For completeness this is the code that worked (except for the title field): class HideFields extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hide Fields', 'version' => 100, 'summary' => 'Hide fields', 'singular' => true, 'autoload' => "template=admin" ); } public function init() { $this->addHookAfter("ProcessPageEdit::buildFormContent", $this, "setHide"); } public function setHide($event){ $wrapper = $event->return; if(!$wrapper->has('Foo')) return; $wrapper->Foo->collapsed = Inputfield::collapsedHidden; } }
  3. For everyone using/copying Juergens last mentioned code; there is a little typo in: public function rendepagetable($event){ The 'r' is missing in renderpagetable.
  4. Thanks fbg13 and szabesz but my purpose is to be able to control the visibility at page-level and not only at template-level. I know there is also the possibility of inputfield dependencies but in my case this does not suit my needs. The code above is a simplified version of my original code but shows exactly the problem.
  5. Hello, I'm trying to hide a specific field with a hook. This is what I tried so far. Changing the field label works but the hiding not. Changing addHookBefore to addHookAfter makes no difference. I searched the forum and found similar thread but could not translate the answer to this situation. Any help would be appreciated. class HideFields extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hide Fields', 'version' => 100, 'summary' => 'Hide fields', 'singular' => true, 'autoload' => "template=admin" ); } public function init() { $this->addHookBefore('Inputfield::render', $this, 'setHide'); } public function setHide($event) { $inputfield = $event->object; if($inputfield->name != "Foo") return; $inputfield->label = "Bar"; // This works $inputfield->collapsed = Inputfield::collapsedHidden; // This doesn't work } }
  6. Thank for your quick reply. In the template "acces tab" I cannot find the option to prevent a user to delete a page. I searched all the other tabs but could not find it. But in my case the editor does not have the right to delete pages (role setting) so he should not be able to delete the pagetabel item.
  7. Is there a way to prevent deleting a PageTable item for a user. It would be nice if it could be set on a user / template base. I know a hook is the way to do it but setting this up myself is unfortunately not within my reach. Any help would be appreciated
  8. I got this same SQL error (pw-dev 2.5.18, php 2.3.29) as verdeandrea. It occurred when adding a new language. Used Adrains fix to restore the database and got PW running again. But after that there still are things not OK with the database. When adding a title to the language it gave the error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status1247' in 'field list' Deleted the whole language, installed the latest dev (2.5.21) and changed to php 5.4.34. Added a new language again but got exactly the same error as posted by verdeandrea. If you need additional information or want me to test something I'll be happy to do that. Alfred
  9. Thank you for this great module. So far ik works very well. One little thing I noticed is that in the modules log file with every page load (site not admin) it writes the line: 2015-02-05 16:21:06 ? ? Saved module 'FieldtypeCroppableImage' config data. The logfile contains more than 12000 lines since I installed the module 5 days ago (2.5.16 dev) If you want more info I'll be happy to help you Alfred
  10. Thank you both for these quick responses, Mont, I've installed the profile en this approach makes sense. Since I will not reuse the blocks/tools on other pages I will name it something like "home page blocks" and place it direct under the Home page in the tree. This probably will visually make the most sense to the editor. Instead of selecting the blocks in the Home page template I will merge them in the php template because it is not necessary for the editor to add / delete or rearrange blocks. Jan, I'm afraid I need more time to fully understand what is meant here and how to implement it my case but thank you anyway for pointing this out to me.
  11. Hi there, I've created this sample home page As you can see there are some repeating parts (wide image, heading etc.) but they are all followed by a part that differs from the rest. Notice also that the top wide image is higher than the other two. For the images I use the CroppableImage module (it's in alpha but so far it looks stable). For my client I want the admin as simple, intuitive and logical as possible. What would be the best practice to set up the back-end template. Thanks Alfred
  12. For anyone getting a screen full with “Warning: Cannot modify header information” This is because you probably have Processwire in debug mode ($config->debug = true;) Thx WillyC this old thread gave the answer And thank you too Wanze for this great module. Alfred
  13. Thank you Ryan. PW keeps amazing me. I tested it and it works like a charm. One thing though. Is it also possible within a repeater field? I tried it with this selector: parent=page.name-repeaterfield.country but it is probably missing the individual repeater field (or maybe is it not possible at all this way).
  14. Thanks Apeisa for your reply. I will use your suggested solution.
  15. Is there a way to make the values of one dropdown dependent on the chosen value of the other dropdown? For example if I choose in a country dropdown "France" the second City dropdown will show "Paris, Marseille, Lyon, Toulouse etc." Thanks Alfred
  16. Built this Dutch site for friends of mine ( www.talk-about.nl ). It's a lightweight, straightforward website but sufficient for their needs and they are very happy with it. When it comes to computers they are a bit heavy-handed so I ended up doing the content editing myself. That experience made me change TinyMCE for CKEditor which in my opinion feels better. Installed Pro Cache and that makes the site lighting fast. First only could get it to work locally and not on the live server. Appears that Pro Cache is not working when PHP is in safe-mode. Used this as a study project and it made me very exited about ProcessWire.
  17. Hello Ryan, In the introduction you write that there is an issue when using ProCache with the LanguageLocalizedURL module. Is this still an issue and if so when do you expect it will be save to use? Thanks BTW, and thank you and all contributors for making ProcessWire for what it is (and will be in the future). With Processwire I feel like starting to build what I want instead of first stripping what I don't want. I've tried several CMSs and examined how far I could get (with my limited coding capabilities) to make exactly what I want. Processwire is the first that hasn't stopped me and doesn't force me to make all kinds compromises.
×
×
  • Create New...