-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Files by language, how would you do it?
adrian replied to heldercervantes's topic in General Support
Yes of course - sorry, you can't actually "find" a specific repeater item. However one thing you might prefer is rather than using a Page field for the language, just use the built in "language" field. -
Glad to hear. I am actually thinking that perhaps the Repeaters parent under the Admin should be automatically excluded. That config setting should really be for PageTable parents and other things that maybe in undefined locations, but we always know where the Repeater parent is.
-
@flod - exactly as @Gideon So suggests. You are looking for the "Branch Edit Exclusions" setting: "Selected branches will be excluded from branch edit restrictions. They still won't show in the page list, but they will remain editable, which is useful for external PageTable branches etc." I suppose it should also mention "Repeaters" as well as PageTable branches. Please let me know if everything works properly once you take care of that.
-
https://towait.com/blog/processwire-field-template-module/ http://page-online.de/tools-technik/processwire-ist-ein-schlankes-und-flexibles-cms/
-
Files by language, how would you do it?
adrian replied to heldercervantes's topic in General Support
Nice one! Try this: $page->langFiles->find('lang.name='.$user->language) -
Just seems like it would be an easy way to check access. You could of course do a partial match, or match a custom field on the user template for each user against the page name. Lots of options - just depends what suits your needs the best and is easiest to maintain depending on how the users are added to the system.
-
Files by language, how would you do it?
adrian replied to heldercervantes's topic in General Support
Correct - that is how those language alternate fields work. Just add the name of the language as a suffix to the base field name and it should all be taken care of automatically. Maybe not the cleanest solution because you do need a new field for each language, but other than that it works seamlessly in my experience. -
Just hook into Page::render or Page::viewable and check the user name against the page name. Sorry, no time for example code, but take a look at the Page Protector module - it should help you with code.
-
Files by language, how would you do it?
adrian replied to heldercervantes's topic in General Support
Works great for file fields for me - I use it for different language versions of the same PDF report. I don't think you want outputformatting off though - you'd want it on to get the localized version of the file and its description. Maybe someone with more ML experience might have an idea why it's not working for you? -
Files by language, how would you do it?
adrian replied to heldercervantes's topic in General Support
This is the approach I use for ML file fields: https://processwire.com/api/multi-language-support/multi-language-fields/#language-alternate-field-values -
Image save issue in custom page edit process module
adrian replied to simon's topic in Module/Plugin Development
I don't know what your ajaxSave() method does, but get it to save the file to a temporary path, then do: $page->image_field->add("path_to_temp_image"); $page->save("image_field"); and everything should be fine. -
Options needs to be an array: array('upscaling'=>false)
-
That makes sense for sure. When I sent you those other links, I assumed that the usernames would be different to the email address.
-
Something sounds wrong there - are you sure you don't have something else that is handling the email to username check? I don't see anything in the login method to handle an email: https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Session.php#L704 and it doesn't work for me.
-
Not sure, but maybe try hooking after: Session::redirect Or maybe you need to: $session->logout() first.
-
I don't see why not - I never really thought about it before, that's all. Trouble is that I now have too many modules and not enough time I wasn't really sure how much use this module was getting. Is anybody else using this regularly?
-
Hi everyone, Thanks to @Richard Jedlička for testing and ideas, there is a new version available. New features, both off by default: Option to control pages saved via the API - respects all defined settings, just like via the admin GUI. Option to set the name to match the title, even if the title wasn't changed during the current page editing event. Let me know if you notice any issues with this new version.
-
Save position: https://github.com/adrianbj/TracyDebugger/blob/865a669a3ddfc0e528413452235e8aefe50e332e/ConsolePanel.inc#L95-L107 Restore position: https://github.com/adrianbj/TracyDebugger/blob/865a669a3ddfc0e528413452235e8aefe50e332e/ConsolePanel.inc#L540-L545
-
Two options: https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?page=4#comment-89599 https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?page=4#comment-89616 You should read about the pros and cons of each.
-
http://modules.processwire.com/modules/markup-dribbble-feed/
-
I use that technique in the Console Panel of the TracyDebugger module - it's pretty easy to implement by storing the current position in LocalStorage or cookie. Perhaps you could send Ryan a PR with the added functionality?
-
What you want is domdocument: Google this: php domdocument get first image
-
Checking if a body field has an image in it or not should be as simple as: if (strpos($page->body, "<img") !== false) { // contains at least one image }
-
Or if you come across a situation where you don't actually need the children, this is quicker: $child->numChildren(); but of course if you already have them, then there isn't much point doing this.