-
Posts
338 -
Joined
-
Last visited
-
Days Won
5
Everything posted by virtualgadjo
-
hi again, as i love these little kind of challenges ? found out something as i said, just add a config.js file inside the module folder (not the plugins one, just site/modules/InputfieldCKEditor/) with this CKEDITOR.editorConfig = function( config ) { config.tabSpaces = 4; }; and your tab key will add four in a row which you'll not be loosing on the front side have a nice day ?
-
oh, sorry, forgot to speak about highlight.js, honestly this is more a styling librairy you'll use for the front end... but you can also add a config.js file in the module folder to overwrite some default ones or add some functionnalities (sometimes useful event for some plugins) with CKEDITOR.editorConfig = function( config ) { // your js // could be as simple as config.extraPlugins = 'codetag'; // but you can add more :) }; but i would not abuse of this possibility not to complicate things in the admin ?
-
hi, well, as i said, that's where you'll have to try... for example, try CodeSnippet or Codesnippet between commas if inside a line or just after a comma if at the end of a line, save and have a look at a page using the field by default, pw only lists the... by default available buttons but you can add as much as you need ? have a nice day again ?
-
Hi, juste for those two plugins, you'll find the links here https://ckeditor.com/docs/ckeditor4/latest/examples/codesnippet.html just pay attention when you download a plugin, quite often there are dependencies you'll have to download and install too installing a plugin is often as easy as putting the folder into the pw site/modules/InputfieldCKEditor/plugins folder that pw creates the first time you choose CK editor as your textarea field type afterwards, in you CKE field config you'll see the list of plugins that are in this folder, check the ones you need when a simple functionnality like nbsp for example, nothing else to do, when the plugin allows you to add a button to the toolbar, will be your case, just add its name in the toolbar list of buttons the pw way where you want it to be you'll probably have to test where to use uppercases but honestly, it works like a breeze too ? have a nice day and CKEditor trip ?
-
what @Jan Romero says ? and i would just add, if your code snippets are parts of a larger ckeditor content type, you could just add their code snippet plugin and, if you want it to be stylized the dev fashion way, add the code snippet geshin plugin too ? ckeditor is easy to customize and has a bunch of plugins you can use depending on what you need have a nice day
-
Hi, hard to answer without knowing which formatter you're speaking about and in which type of field what i can just say about the code snippet you've posted is, in a template code it would easy to indent with \t echo "\t\t" . 'This site has a Code button...' . "\n"; echo "\t\t" . 'That's precisely what I need in my editor...' . "\n"; echo "\t\t" . 'Where do I get it?' . "\n"; would indent each line with two tabs and \n will create a new line, your three echo will end in a single line but i guess that's not the actual code you're writing... ? have a nice day
-
Get value in other language (not default) if field value is empty
virtualgadjo replied to nabo's topic in General Support
that's why what i suggested is to - grab the default language value - then grab the current language value - comparing them both, if the current one is the same as the default one, the value for this language is empty as if it weren't both values would be different ? if they are identical, up to you to do what you want ? and pw is so fast, this shouldn't be too consuming have a nice day -
Get value in other language (not default) if field value is empty
virtualgadjo replied to nabo's topic in General Support
Hi, too bad, if you can't change it because it's used in other circumstances for the given field, the simplest way i can imagine is, when you need a different behaviour, in your template, just check if the value for a given language is the same as the default language one and, if so, just grab the value from another language, a bit savage but it should work ? have a nice day -
Get value in other language (not default) if field value is empty
virtualgadjo replied to nabo's topic in General Support
Hi, have you tried checking the "remain blank" option for the fields you want to work this way as, by default, it's the "inherit value from default language" that is checked? have a nice day -
Hi, running quite often ibto that kind of situation i now use a solution that seems a little like @DaveP's one let say you need a gb img or the large image on top of each page i always create a default fields "page" with a no-file template (hidden page of course) then i create the bg_img image field that will be used in every template, including the default fields one and, for this field i use the default value feature provided by pw, guess, the default value is in... the default fields page ? this way, no need to fill this field for every page but if you need a specific image for some pages (something that happens quite often in real life ? ), easy peasy, just fill the field in those pages in case it may help have a nice day
-
Hi Vincent, sorry to be a bit long to answer... as soon as i can get some time to have a try at this pull request thing, i'll do it (currently working on a complicated website, with pw of course :)) the thing is i like to test things before making big mistakes that don't only impact... me and as much as i like playing with git, having always been working alone, i have never used those collaborative functions except for, looong ago, with the old svn ? in the meantime, don't hesitate to do exactly what you want with my repos, they are here to be useful without any need for me to be tagged, quoted and so on ? Have a nice day
-
thanks again @Robin S this could make me try to the module in a repeater as it uses ajax loading a lot even if it uses "transparent" pages too ? will i resist to try? it's such a client helper when editing their website ? have a nice day
-
Hi @Robin S and again, thanks so much for your answer, it works!! and, not only does it work but it helps me understand even deeper how pw back office works i went for the first solution if(!$input->is('post')) { // works fine too :) as it may help for other kinds of fields that need formatting to be used in the back office the same way as on the front end like, in my case, @kixe's FiedtypeColor to get the formatted output # included again, thank you very much for your time and insight have a nice day
-
Hi Vincent, very honoured that my little translations may have any interest ? actually, i don't really know how to do what you're talking about but i'll have a look at it just a little detail, you may have seen that i keep a different repo for each pw master release because i've conviced a few french friend to use pw and depending of the version updating the files may lose some older texts actually as i keep translating release by release i've even considered making a different repo by dev release or creating a new repo with all the translations in zips named after the release this explains why the zips with the fact it's also the easiest way to update a language translation, uploading a zip that pw will unzip server side and boum everything is up to date ? just tell me what would be the best way for you to use my repos (one called last master release with the json files? and keeping the others for my friends using older releases for example) have a nice day chris
-
Hi @Robin S apparently i'll need some more knowledge from you, running into a new little issue i have a template to generate a block, let's call it a push there is again an image depending of the type of push and i call it this way (the way you teached me ? ) $image = $page->getFormatted('square_fr'); if i put an image in the field, everything goes fine if ever i save the page forgetting to fill this field, impossible to add it afterwards and save again, the field stays desesparatly empty and doesn't save my image, no matter the type of condition i try before getting this image if i remove the runtime field from the template, i can put an image and save it again it works; i'm sure i've missed something but honesty i can't find out what, i looks like the runtime field has also an impact on the whole admin page and prevents the image field from working once the page is saved with an empty field any idea would be very welcome ? have a nice day
-
Hi @Robin S and wow, thanks a lot for your answer and this greeat explanation! funny enough, i've written a lot of modules for customers using this $page->of() function to allow validation of values submitted with a front end form to create pw pages but never had to deal with displaying images in the back end, thanks to you i won't be surprised when it happens ? and thanks for the snippet too, cleaner and more pw like than my concatenation ? one more day i will go to bed a little less dumb ?? have a nice day
-
Hi, great module, just a little funny thing i've just ran into i use it to render in the admin a square component made with pages that may contain an image or have a background-image the image field is named squareimg and is set as a single image field, not an array // if i use echo $page->squareimg->url; // the usual pw way, it returns /site/assets/files/xxxx/ echo $page->squareimg; // returns the name of the image i've got to write echo $page->squareimg->url . $page->squareimg // to get my full image path just in case it may help ? have a nice day
-
hi, just to explain what @iank said, first of all your $page->save($number) couldn't work because what is number, where to save it and so on ? to do it the way you were going to, you would have to write $number = $page->number != '' ? $page->number: 0; echo $number; $number++; echo '<br />new' . $number; $page->of(false); $page->number = $number; $page->save(); and, as you can see @iank solution is faster and, quite often, when coding the shorter, the better ? have a nice day
-
Hi @pwired well, very often on a website page you will end with let's say, a top page image (or carrousel) image that can be used in the content (text and so on), just for fun add a repeater with blocks linking to another page... pw allows you to build an intuiitive back end interface with - a single-file image field for the top image with a specific description about the format/ratio/min-width - same thing in case of a top carrousel but with an field set to an array in these two cases you can set image crop ratio plugin with the needed ratio - les add in each repeater item a single file image field with a 1:1 ratio beacause your design requires a square of course - why not another array like uimage field for a gallery that will appera on the page only if there are images in ... i let you imagine the other possibilities doing this makes your back end easy to use and understand for customers that stop being afraid of feeding their website, exactly what i love and so do my customers ? with pw the more granular your back end is the happier your users are too ? and of course field being in the most logical order according the the template design, thanks to pw incredible flexibility and variety of chosable fields and options, it makes quite complex designs so easy to edit... have a nice day ?
-
as i said, if images is set to be a single-file field read the full answer you'll see ? and it's something i often use for some fields, say the top page image for example, using the single-file option pw still allows you to fill the image field with as many images you want but (if your field is named images...) $page->images->url will always take the first one, simple way to give a customer a "stock" and a possible choice that can change when you want just ordering the files to put the one you want to see in pole position have a nice reading the full posts day ?
-
Hi, like @flydev ?? says, it depends on how you've set your field options what i can add is that images[0] won't work, first() or ->eq(0) are far better but, even if it seems obvious i'd just like to add something else, if you want to display images you have to use the img tag... (sorry again if it is that ovious) so, something like this will work assuming your field is set to contain an array <?php foreach ($page->images as $img): ?> <img src="<?php echo $img->url; ?>" alt="" /> <?php endforeach; ?> if it is set as a single file field <img src="<?php echo $page->images->url; ?>" alt="" /> will do the trick ? in case it helps have a nice day
-
my pleasure ? have a nice day
-
Hi, maybe it's because your class isn't really... a class but a full inline style ? have you tried 'class': 'your_class' and then setting the syles in your css? have a nice day