Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by virtualgadjo

  1. Hi good to know it works for you, as pw always do actually πŸ˜„ coming to your image issue, in order to make this kind of input work with preview, deletion and so on, you'll have to use ajax, the choice is quite simple, jquery or not jquery πŸ™‚ with jquery you'll find a lot o working plugins, the famous oldie one blueimp but many others too without jquery, you'll mainly find code examples you can extend to implement the functionalities you need, deletion for example if your form is a user profile settings form, you may also have a look at pw login register pro module that comes with an very interesting file/image input in any case, i'm sure you know that when you allow uploading files from the front side, security is the main thing to keep hardly focused on... have a nice day
  2. hi, you are absolutely right a text input width a choose... label would be a bit wierd too πŸ™‚ actually you showif idea could be a solution too, you could just put label and select inside a wrapping element (div?) and if you have only one option just add a class to that wrapper that send it 10000px to the left with an absolute position, this way it would keep working but without being shown the only thing is in this case it would be a better idea not to have it on a multi input line on large screen and it would work even better than a show attribute as this attribute would not work on the label but only on the input have a nice day
  3. Hi, if you don't want to allow 0 option selected (compusaltory field) as i agree with you, a select with only one option..., honestly, in this case i would do this server side if there is only one option retrieved from your query/selection or however you get the options, display a text field with readonly attribute else, display... a select πŸ™‚ have a nice day
  4. Hi, without seeing the full form code it's hard to answer so don't take it the wrong way πŸ™‚ the first thing to check is that your form has the correct enctype="multipart/form-data" attribute then, have you checked the form really uploads the file into the right folder? i personally use native php move_uploaded_file, example for a simple file $cv = nom_fichier($_FILES['cv']['name']); // nom_fichier is a personal sanitizing function, yes, i'm a frenchie :) but you can use pw great one if ($cv != "") { move_uploaded_file($_FILES['cv']['tmp_name'], $filefolder . $cv); chmod($filefolder . $cv, 0777); } and then zip it server side (security...) and attach the zip file with wiremail attachment before deleting it after sending the mail but you can see a full pw example here https://gist.github.com/somatonic/5233338 one thing i can say for sure, $m->attachment works fine, i often use it for application form with two compuslatory file fields (that end in the same zip server side :)) hope it helps have a nice day
  5. Hi, just a little idea i often think about, when you create a fieldset field and you give it one or more tags in the advanced tab, it may be a good idea that the fieldset_END gets the same tag(s) by default instead of ending in the fields with no tags list πŸ™‚ have a nice day
  6. hi @adrian and thanks a lot for your answer, i'll try tu use AdminActionh for this too, didn't think of this although i often use AdminActions for many other purposes πŸ™‚ i've solved my current problem using batch child for the fields i need in the default language adding the page id to the field list and using Ryan recent ProcessLanguageFieldExportImpor to export the multi language ones then i just had to agregate both csv based on the page ids you're right, my first thought was to write my own code but pw does so many things "by itself it must have made me a little lazy πŸ˜€ have a nice day
  7. Hi, fantastic module that saved me a lot of time... thanks a lot jusrt wondering, i know, a bit paradoxcical πŸ˜„ if it is possible to include some monolingual fields to the export, for example, speakers whose first and last name of course are monolingual but functions are in several languages or, is the best solution changing the monolingual fields into multi ones, taking advantage of pw ability to fiil other languages with the default one is empty thanks a lot anyway, love it πŸ™‚ have a nice day
  8. Hi, sorry if the question ha&s already been asked... couldn't find out is it possible to export multi language fields at once, i.e a web site in fr and en, can i export both values for each field when they are multilingual thanks for any tip πŸ™‚ have a nice day
  9. Hi, if your urls will look like yourdomain/company1 yourdomain/company2 you can simply reproduce your sketch with pw page structure but if each company must have its own domain name i think the multisite solution, even if a little "too much" πŸ™‚ will be the best solution to avoid those 301 you're speaking about (savage and headaches to come πŸ™‚ ) and for a better SEO have a nice day
  10. @Robin S wow, same result as my template selection thing but this makes me understand how pw does it, thanks a lot πŸ™‚ @rooofl of course, Robin S example also works with a select made with a page reference field have a nice day
  11. Hi @Gideon So i can see this working with a foreach on the front side but as the question was to populate the field in the admin interface i deadly have to try this, pw would be even simple than i thought πŸ˜„ have a nice day
  12. hi again πŸ™‚ actually i'm referring to the field you use in the repeater, whether or not it's the one you use as the item title in the page as it is natively the one pw will use in a page reference field coming to this page reference it's just the type of field easy to populate with a list of "pages" of your choice, here the repeater elements, thanks to the fact pw create a template for the the repeater elements and a page for each element (bot the most poetic sentence... guilty as charged πŸ˜„ and, in this field parameters (input tab) you just have to choose your repeater template pw has created on the fly here, just for the example, my repeater was named... my_repeater πŸ™‚ have a nice day
  13. Hi, there is an easier way to do this πŸ™‚ to make it eve easier i use the title* field in the repeater elements as pw uses it to make the list then, for your page reference field just choose repeater_yourrepeatername in the template choice, done πŸ™‚ have a nice day
  14. or not, affirmative πŸ™‚ actually, using markup regions, you have multiple choices to echo contents but markup regions or not, just remember that when you do things within the php tags before echoing any output, this happens even before the html tag (the _main.php file is included to the end of your template) usually, with markup region, this top php block is used to find pages, prepare some foreach and so on but don't worry, what happens inside the html tags below is only executed once, be it inside the main container you have in all your templates or in those "optional" blocks you can define with the pw attributes πŸ™‚ have a nice day
  15. Hi, even without seing the whole code, the first thing that comes in mind is you echo is not inside any html tag the php block with the namespace is not really made for receiving any output except for testing reasons, have you tried erasing the echo here and putting it inside an html part below (inside your .card for example)? have a nice day
  16. Hi, life without processwire would be so sad, so, here comes the translation (into french, no kidding... 🀣) for the last master release https://github.com/virtualgadjo/pw30210-lang-fr @vincent sorry to be still so dumb with github... of course, as it will always be, you are very welcome if you'd like to use those files to update you repo (if i haven't missed anything, there is no empty line when checking the full list of files in pw admin, if ever i found one i would of course update the zip) have a nice day
  17. hi, actually, you can @import your fonts in the css you use for CKeditor, use one for the body, another for the h/titles and wichever you need for specific contents using classes you set in your css and define in the style select with the custom js else, you could of course add ckeditor "font" addon but honestly it is rarely a good idea to let non designer users transform the content into a fonts and font-sizes festival (same thing for the colors...) πŸ˜„ https://ckeditor.com/cke4/addon/font Have a nice day
  18. Hi, two more litte cents πŸ™‚ if this hosts var is not well filled you may also run into another little problem as pw automatically build the preview links in the admin based on this var have a nice day
  19. Hi @marie.mdna if i'm not wrong this depends on your config file $config->httpHosts var, if the first host in the array contains the www, the sitemap will use it too (at least, that's what happens for all the websites, a lot..., for which i've this module installed πŸ™‚ have a nice day
  20. hi @elabx you're completely right, and following you on the elaboration path, my savage little script is just the php way of doing what @mel47 was trying to write with any kind of array and number of columns but, honestly, nowaday, if i had to do this, as much as i love php i would probably simply iterate the array in the template inside one div/container and use css to generate the columns... πŸ˜„ have a nice day
  21. Hi, i think this is more a php question than a pw one, then i'll answer in my savage php way πŸ™‚ let's assume $intruments is an array and you don't know how many intruments there are, you don't need those first, second col and so on, just iterate $isntruments $total = count($instruments); $colmax = ceil($total / 3); $i = 1; $out = '<div class="column">' . "\n"; // or .= if $out is initialised above foreach ($instruments as $inst) { $out .= '<p>' . $inst . "</p>\n"; if ( $i == $total ) { $out .= "</div>\n"; } elseif ($i < $total && $i % $colmax == 0) { $out .= "</div>\n"; $out .= '<div class="column">' . "\n"; } $i++; } echo $out; // or return if in a function should do the trick, no matter $instruments contains 15, 17 or 200... instruments πŸ™‚ have a nice day
  22. hi, the pw way on top of a page $input->urlSegment1 you can use various functions to check if there is one or no, for example if ( strlen($input->urlSegment1)) $foo = ... and of course validate if the segment is an authorized one, regex for example, beginning with the segment you accept in the model parameters (i nearly always use regex, i.e regex:^[0-9]{1,5}$ //or 6,7... depending on how many pages you'll have :) that will check the segment looks like a page id, if not, 404... now, coming to hooks, never did this, il let @Robin S answer this, he knows pw and hooks far better than i do πŸ˜„ have a nice day
  23. Hi, @Robin S is right, my url segment idea is not necessary but just a simple way to keep the page id alive πŸ™‚ now, honestly, when i have to do what you described, as much as i love coding, hooks and all what pw gives us i would probably use session vars the way @Robin S shows in the hook but simply in the login page code, maybe because i'm too used to doing this kind of thing without the help of pw... - if the user arrives unlogged on the page, i would set a session var with the id of the page and then redirect to the login page (instead of login/pageid that doesn't need this session var) - if the login is successful, simply use pw redirection abilitiy to the page the id is in the session destroying the var that isn't useful anymore but using the login/register plugin @Robin S's hook is more the pw way of working than my savage 'manage your life on your own' solution πŸ˜„ have a nice day
  24. @bernhard yeah, i love the page with all the needed snippets! exactly what i have done for a client who needed many carrousels they could use on several pages where they want a parent page with children, each one containing a carrousel and hannacode to use those any where in content fields @Robin S HannaCodeDialog could also help in this case that's what i love with pw, with a little imagination, it lets you do whatever you want in an incredible easy way for the customers to edit πŸ™‚ have a nice day
  25. Hi @Robin S let's imagine this https://foo.com/userlogin/3025 isn't it easy to grab 3025 and, if the login is successful, redirect the user to $pages->get(3025)->url;? would be the same with a page name and easy to change each time the page you need to redirect to does just a simple question πŸ™‚ have a nice day
  • Create New...