Jump to content

mel47

Members
  • Posts

    297
  • Joined

  • Last visited

Profile Information

  • Location
    Montréal, Canada

Recent Profile Visitors

2,239 profile views

mel47's Achievements

Sr. Member

Sr. Member (5/6)

80

Reputation

  1. 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!
  2. 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!
  3. Thanks! I tried many versions, but apparently I missed those ones... ?
  4. 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; }
  5. 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
  6. 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
  7. 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)
  8. 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
  9. 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
  10. 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
  11. 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();
  12. 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
  13. 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
  14. 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!
  15. 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!
×
×
  • Create New...