Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by mel47

  1. Oh, yeah, I was thinking in term of <picture> not PageImage. But it works now by changing as suggested. Thanks!
  2. Hi @nbcommunication I discovered the benefit of srcset tonight and it's easier with the module! Thanks. I have a question. How can we manage "art direction" with the module? I had this 2 image sources but I don't know how to implement using module's API : <picture> <source media="(max-width: 799px)" srcset="<?=page()->rootParent()->image_haut_mobile->url?>"> <source media="(min-width: 800px)" srcset="<?=page()->rootParent()->image_haut->url?>"> <img class="image" src="<?=page()->rootParent()->image_haut->url?>" alt=''> </picture> Thanks! Mel
  3. Hi I installed a new instance of PW (3.0.200) with default settings for database. So the database is : utf8mb4_0900_ai_ci However I use french language and when I use code button for TinyMCE I have things like &agrave; etc... But not for fields using CKeditor. Is it the new behavior, a bug or I have to change something somewhere? Thanks Mel
  4. Hi, I advanced a little bit but I'm still stuck... 🙃 I used templates to add this code, works fine! However, whatever I do, when I save the page, the class disappear from code. I tried to add those classes in "extra_css" in TinyMCE options, but didn't help. In CKeditor, it have an option to allow some classes to be not striped from code. Does is have this option for TinyMCE? Thanks Mel
  5. Hi, I know this subject has already been discussed, but I was wondering if TinyMCE will simplify things. I want to do a editable text by users in a 3-columns layout for a specific page, in the middle of some content. The content of the page is a simple body field with CKeditor/TinyMCeditor (not decided yet). Columns are managed by CSS, something like : <div class='columns'> <div class='column is-4'> <div>Text/image to edit</div> </div> <div class='column is-4'> <div>Text/image to edit</div> </div> </div> What is the best way to achieve this inside the editor? Or it's better to create own field for each column, so code will be in template? Thanks
  6. Hi I'm trying to create a markup of a list of options in 3 differents columns. I'm not sure how to do it. For now, I'm able to display each title: $field = wire('fields')->get($instru); $instruments = $field->type->getOptions($field); foreach ($instruments as $inst) { $out .="<li><h5 class='title is-5'>{$inst->title}</h5></li>"; } But I want something like this. Does it make sense? Or what other strategy I should aim? $field = wire('fields')->get($instru); $instruments = $field->type->getOptions($field); $firstCol = Options 1 to 5 // how to do? $secCol = Options 6 to 10 // how to do? $thirdCol = Options 11 to 15 // how to do? $array = [firstcol, seccol, thirdcol] foreach ($array as $col) { $out .="<div class="column">"; foreach ( ?? ) { $out .="<li>title</li>"; } } Thanks!
  7. Hi! I wondering if we transliterate any type of field. In fact, I want to transliterate titles from a fieldtypeOptions. I didn't work, however it's works well for a text field. Thanks!
  8. Thanks! I tried many versions, but apparently I missed those ones... ?
  9. Hi, Thanks. I put what I've done but it didn't work and I'm not sure it's the best way. function renderBio(PageArray $items, string $categorie) { $out = ''; foreach ($items as $item) { $photo = ${"$item->image_".$categorie}; //should be $item->image_director $bio = ${"$item->content_".$categorie}; //should be $item->content_director $out .="<div class='article columns is-multiline border-horizontal is-vcentered'> <h3>{$item->title}</h3> <div class='column is-3'> <img loading='lazy' src='{$photo->url}' alt='{$photo->description}'> </div> <div class='column is-9'>$bio</div> </div>"; } return $out; }
  10. Hi, Unfortunately I can find what is the problem. I don't think it's related to my templates, since it didn't work even in Tracy. In my previous project, the same code render correctly a menu. Same PHP version 7.2 (localhost) but different versions PW (3.0.206 vs 3.0.188). Mel
  11. Hi, For my new project, I'm trying to increase my optimization skills... So I have a template with fields Name(title) content_director photo_director content_prof photo_prof etc... I want to write a function to render a identical markup (renderBio(PageArray $items, string $category)), but for pages director or prof. However I tried many ways and I'm not sure how to do. I could do it with many IF but I would prefer an other solution. I tried to concatenate $item->content_ and $category but can't found the appropriate set of {}, "" or ''. If not I could use an array, but I'm not sure what to add in. Or maybe find fieldname ending with $category? What solution would you preconize? Thanks. I'm eager to see your solutions! Mel
  12. Hi, Just to say that I'm quite interested by an answer to be give to @Greg Lumley since I have the exact same problem. I used this module in previous website so I was thinking to know how to use it... Thanks (using latest 0.2.7 on PW 3.0.205)
  13. Sorry to come back again on the subject, but does someone have an idea why we can't see data if we are logged as admin? Before (unfortunately, don't remember which PW version it was), it was displaying correctly. I'm willing to modify anything : role, permission, module to get it working. I just want to avoid to give super-admin rights. Thanks Mel
  14. Thanks for answer. Honestly for now, as I said RockGrid perfectly fit my needs. Here the JS error (appearing only to non super-admin users): Uncaught SyntaxError: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data onreadystatechange http://localhost/dev/site/modules/FieldtypeRockGrid/RockGridItem.js?t=1635649449:290 getAjaxData http://localhost/dev/site/modules/FieldtypeRockGrid/RockGridItem.js?t=1635649449:288 init http://localhost/dev/site/modules/FieldtypeRockGrid/RockGrid.js?t=1635649449:188 init http://localhost/dev/site/modules/FieldtypeRockGrid/RockGrid.js?t=1635649449:223 initGrid_suivi_org http://localhost/dev/admin/gestion24h/suivi/organismes/:290 <anonymous> http://localhost/dev/admin/gestion24h/suivi/organismes/:301 RockGridItem.js:290:31 onreadystatechange http://localhost/dev/site/modules/FieldtypeRockGrid/RockGridItem.js?t=1635649449:290 (Asynchrone : EventHandlerNonNull) getAjaxData http://localhost/dev/site/modules/FieldtypeRockGrid/RockGridItem.js?t=1635649449:288 init http://localhost/dev/site/modules/FieldtypeRockGrid/RockGrid.js?t=1635649449:188 init http://localhost/dev/site/modules/FieldtypeRockGrid/RockGrid.js?t=1635649449:223 initGrid_suivi_org http://localhost/dev/admin/gestion24h/suivi/organismes/:290 <anonyme> http://localhost/dev/admin/gestion24h/suivi/organismes/:301 Mel
  15. Hi @bernhard I have a question. I used RF1 and RockGrid. I saw both are deprecated. Since for now, it suits my needs coupled to a lack of time to rewrite my queries, I don't really want to convert to RF3. But I now do need to show data to admin users (and not just superadmin). Currently the table, in a custom admin page, just show "loading". Can I kindly ask how I can display data my users? Sub-question : if rockgrid is deprecated, what else I should use? Thanks Mel
  16. Hi, I have this working line to find a specific image. $banniere = $pages->get(1)->images->findTag('banniere')->getTag($user->language->name); But now, I want to add getRandom(). I tried different versions $pages->get(1)->images->findTag('banniere')->getTag($user->language->name)->getRandom() $pages->get(1)->images->getRandom()->findTag('banniere')->getTag($user->language->name) but always received this error : Method Pageimage::getRandom does not exist or is not callable in this context. Is it compatible? How I can do that? Thanks! Mel EDIT : solved by myself. Error I commonly do, mixing up get() and find()... Sorry for the disturbance. $banniere = $pages->get(1)->images->findTag('banniere')->findTag($user->language->name)->getRandom();
  17. Hi, Thanks for your module. It works really, maybe too much! ? I'm wondering if there a way I can limit to the first occurrence of a link in a page by a hook or something. I like the automatic behavior of the module, however I have pages where I repeat the same word each 2-3 sentences, rendering the paragraph looks as a big link to the same page. Thanks Mel
  18. Hi, I'm not sure this will solve my problem. If I understand, your module will print og, but I want to do the opposite : grab og from a link. Correct me if i'm wrong, Mel
  19. mel47

    Hanna Code

    Hi, I know this module have not changed since many years, but could I suggest to add a description for each Hanna code? I come back to my setup page and have some codes that I didn't update since years and I don't know why/where they used through my website. I would like to have written a small description. Yes, you could tell me I should have written comments in the code itself, and it's what I would do starting from now... ? But something on the setup page will be faster to read. Thanks!
  20. Hi, I have a really basic question, since I'm not sure in which direction I should search. I want to replicate the behavior we see on social media : the url preview of a website but on my PW site. I guess it should be related to opengraph, but in the other way around. However, I found a lot of information about implementation opengraph metatags, but it's always about adding metadata on your website, not scraping them and displayed them. Someone have pointers to help me to find how I could do that? (I also search for a module but didn't find, but I'm not sure I searched with the good keywords). Thanks!
  21. Hi, I have a strange question. I embed twitter link without problem, but the rendering is in spanish (and I tried many links with the same result). Believe me, I have absolutely nothing set to this language on my computer (either PW, or twitter cookie or anything). Have an idea how to revert back this to my language? Thanks Mel
  22. @adrian Forget that, I messed up. I was thinking pages shouldn't be created by API if this option was checked. I created a hook to solve my problem. But maybe you can help me. Which hook I should used? I tried different versions but the most working one is addHookAfter('saveReady'), but I need to re-save each page. I would like the hook worked either if I created a page via BCE or create/save from admin. My hook is to check if the page exist in the pageRef field, if so copy in an other pageRef field, if not do nothing. Thanks
  23. Hi, Question: when adding using BCE, is it attended behavior to create a page (in a pageRef field) even if this field doesn't allow it (unchecked like in image)? If yes, how I can prevent it? Thanks!
  24. Hi, Thanks for your module. I have a question. Does it have a way to sync already existing relationships? Just saving again the page doesn't seems to work, I have to remove and re-add the value. Thanks!
  • Create New...