Jump to content

virtualgadjo

Members
  • Posts

    222
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by virtualgadjo

  1. Hi, i've coded a little plugin that wraps some selected content, several p's, h and so on inside div but i run into a funny behaviour of the editor onAction: function () { let cnt = editor.selection.getContent({format: 'html'}); editor.selection.setContent('<div class="box">' + cnt + '</div>', { format: 'html' }); } It works fine but tiny adds an an empty p before and after the div, not really a problem as i always use the remove empty p option but just wondering why 🙂 have a nice day
  2. Hi, glad to hear this, 🙂 it took me some time to find out the righ way to do this,, this method allows you to insert many kind of templates, you can just choose the one you need on click on the template button have a nice day
  3. Hi, i think that using this method you'll probably run into the same problem i did, you insert a div but can't wrap several p inside it and, if ever you hit enter, it will just cerate another div same thing if you select two or three p and try the div option, it will simply transform each p into a div fortunately Ryan's article helped me find the right solution, here https://processwire.com/blog/posts/using-tinymce-6-in-processwire/#example-of-configuring-the-template-plugin a few tries later i ended with this kind of thing { "add_toolbar": "template", "add_plugins": "template", "templates": [ { "title": "Wrapping div", "description": "add a div with content", "content": "<div class='foo_wrapper'><h3>zi fabulous title</h3><p>a paragraphe.</p><p>an other one just for fun</p></div>" } ] } now you have a div with rich content you can modify, add other p or whatever you need, just click where you need it in the field and hit the template button, job done you may have noticed that the class is wrapped with single quotes for json reasons 🙂 but when you insert it in your field tintmce changes them into double quotes by itself in case it helps have a nice day
  4. Hi All Hi @vincent as pw master release has just increased its number, so have i done with my french translation repo https://github.com/virtualgadjo/pw-30226-lang-fr the language files haven't changed but i've exported it from the 3.0.226 release admin after my usual check up hence it sounds better to have the same "name" as pw, pw is the master, not me 🙂 have a nice day
  5. Hi all, Hi @vincent here we are, there should be a national holiday to celebrate each new processwire master release but well, meanwhile, here comes a french translation for the admin https://github.com/virtualgadjo/pw-30225-lang-fr as always @vincent feel free to use it the way you want, merge or whatever you do far better than i do 🙂 have a nice and happy pw day
  6. Hi all, Hi @vincent you know, i download and translate every dev release the very day they appear on the website, i'm completely up to date up to the 3.0.224, i think that as soon as the next master release is on air, i won't be long to complete the translation and upload it to github,, of course i'll let you know with a little post here to be honest, i'm even already building a website for a french music school with the last dev release, it will be easy to upgrade with the coming master release 🙂 have a nice day
  7. hi @szabesz thanks a lot don't know why each time i tried to erase empty lines it erased the code parts too, i probably should have wrritten the whole stuff as raw text and then only apply the code parts where needed thanks again have a nice day
  8. Hi, don't know if it could solve your problem (even if already solved 🙂 ) but i once ran into the same kind of issue with external dynamic css file and soled it this way in my config.php file $config->contentTypes = array_merge($config->contentTypes, array( 'css' => 'text/css' ) ); this adds the css file type in your template "files" tab / content-type select then, on top of my bibicss.php file <?php namespace ProcessWire; header("Content-type: text/css; charset: UTF-8"); header("Charset:utf-8"); and i linked to my bibicss page the usual way in the head of the pages that need it and it worked fine i think that would be the same for js files with a simple 'js' => 'text/javascript' and the correct headers Content-type in the template in case it helps have a nice day
  9. Hi, like @flydev says, you need a template for the pages you want to display on the front side... i just wanted to add two little things inspired by your template name "partner_3.php" - if ever there are partner_1, partner_2 and so on pages, it may sound obvious but well... you can of course have a partner.php template and use it for all your partner pages... it's not a page/a template but a kind of page needing which fields then no matter how many partner pages you are going to create they can of course use the same template - coming to those no file templates they are very useful in many case, for exemple imagine a page aggregating children pages that are not going to be displayed by themselves (when the chilodren are going to be a bit heavy or numerous and would slow the admin in a repeater, thos children pages could use a template without php file lots of other cases, one i like a lot a default fields template for a... default fields template 🙂 to centralize the default value for fields you're going to use on a lot of pages/templates (hero img for example) have a nice day
  10. @Sava Hi my pleasure and very glad to know you manage to do what you needed 🙂 have a nice day
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. @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
  21. 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
  22. 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
  23. 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
  24. 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
×
×
  • Create New...