Jump to content

virtualgadjo

Members
  • Posts

    224
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by virtualgadjo

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. @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
  13. 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
  14. Hi, just my two cents πŸ™‚ for a front-end login page, url segments could be your friends (the page to be redirected id, name or whatever you want) a little regex to keep them safe, it wouldn't change the login url and you could grab it like a var, same thing as what @bernhard has highlighted for the pw native login have a nice day
  15. hi, wow, thansk a lot @bernhard i didn't know this module and it looks fantastic i think that it's not exactly what @DansDomain was looking for because the full field is managed by the syntax higlighting you choose instead of being able to post a snippet inside a long piece of "normal" content but it gives me an idea, using ACE for a field, CKEditor for the text content and hannacode to insert the full code field into the CKEditor one, even two or three little snippets and hannacode with the name of the fields as a variable well, sure when you have a lot of little snippets it's probably easier to use the codesnippet plugin and apply classes to the code tags to have them stylized on the front end but i can imagine cases where this ACE/hannacode solution would be very useful thanks again and have a nice day πŸ™‚
  16. 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 &nbsp; in a row which you'll not be loosing on the front side have a nice day πŸ™‚
  17. πŸ˜„ i'm wondering if there weren't a plugin to insert tabs like the one that inserts &nbsp;'s but well, enough with plugins your copy paste solution is simple and simple is beautiful πŸ™‚ have fun and a nice day πŸ™‚
  18. actually, nbsp's is often the solution used by code highlighting plugins... but you may find something useful here https://ckeditor.com/docs/ckeditor4/latest/examples/htmlformatting.html πŸ™‚
  19. 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 πŸ™‚
  20. 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 πŸ™‚
  21. 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 πŸ™‚
  22. 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
  23. 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
  24. 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
  25. 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
Γ—
Γ—
  • Create New...