Jump to content

mel47

Members
  • Posts

    370
  • Joined

  • Last visited

Posts posted by mel47

  1. Hi,
    In readme it said that it have an automatic cleanup (I do have Lazy cron installed). How I can verify if it works (or in fact why it doesn't)? The list is growing and it doesn't seems to be deleted since I installed the module 3 years ago!
    Thanks
    Mel

  2. Hi,
    I updated recently both PW version (to current dev 3.0.233) and module (from 3.1.2 to 3.1.5). I have a problem with interference within FormBuilder module. When I click to edit some PageFields, in my form, I get this message. Not for all fields though. And I don't have this issue in template, view and add new links works fine.
    image.thumb.png.46c3e325fb5e2923dd5e6e9c3b98fe49.png

    Thanks.
    (I post here, since it seems related to this module, but I could transfer the message in FormBuilder forum if necessary).

  3. 14 hours ago, nbcommunication said:

    Hi @mel47,

    This module isn't built to handle art direction I'm afraid, it is to provide a srcset property to a single Pageimage. Art direction will likely require more than one Pageimage (as your example suggests) so this would need to be handled with your own code.

    However, the module should still be useful for your example; use ->srcset instead of ->url in the <source srcset> attribute.

    Cheers,

    Chris

    Oh, yeah, I was thinking in term of <picture> not PageImage. But it works now by changing as suggested.
    Thanks!

    • Like 1
  4. 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

  5. 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

  6. 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

  7. 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

  8. 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!

  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
     

    204.thumb.png.53d57efba2d77a23966d8d5ea981a9b6.png

  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. 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

  13. 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

  14. 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();

     

     

    • Like 2
  15. 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

  16. 6 hours ago, carlitoselmago said:

    I just made today a class for Processwire that automates the process quite a bit. It's really basic, I will improve it in the future.

    https://github.com/carlitoselmago/opengraphPW

    It's used like this:

    
    <head>
    	<?php
    	include_once("./opengraphPW/opengraphPW.php");
    	$OG=new openGraph(
    		$page, // current PW page, required
    		$pages, // PW pages wire object, required
    		$config->urls->templates.'img/cover.jpg', // A general image (1200x628px recomended) for pages like a home page where there's no content image, optional
    		"Title of your website"); // A generic title if the home element is called something like "home", optional
    	?>
     </head>

    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

    • Like 1
  17. 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!

    • Like 4
  18. 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!

  19. 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?

    image.png.748b3a2d020a010a377b735945e2f301.png

    Thanks

    Mel

×
×
  • Create New...