Jump to content

ngrmm

Members
  • Posts

    414
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by ngrmm

  1. 3 hours ago, BitPoet said:

     

    <script>
      var ProcessWire = {config: <?= wireEncodeJSON($config->js(), true, $config->debug) ?>;
    </script>

     

    thx @BitPoet

    I guess there is Typo in your Snippet. Missing closing }?
    However I get a 500 Error.

    So I tried this:
     

    <script type="text/javascript">
    	<?php $jsConfig = $config->js(); ?>
    	var ProcessWire = {config: <?php echo json_encode($jsConfig); ?>};
    	var config = ProcessWire.config;
    </script>
     

    and

    $config->js('mySettings', [
    	'foo' => 'bar',
    ]);

    but console.log(ProcessWire.config); outputs an empty array

  2. 3 hours ago, benbyf said:

    Hi Hi, trying to use this module with Snedgrid but seem to be un able to know if the communication is happening... I've set up an account, verified the domain and email address, set up an API key and adding the code as follows but cant seem to get any emails or activity on sendgrid... anything missing or is this module no longer compatible?

    hey @benbyf, as you see above i had/have same problems. Back then i read something about issues with SSL preventing tracking. 

  3. 5 minutes ago, teppo said:

    Great — let me know if you run into any trouble and I'll be happy to help!

    I found another solution and it works for me. First I loop through my pages and save the needed content into a helper-textarea-field. I added this helper-field into the indexed fields and this works. I guess this is not the best for the performance but it works for me.

    Thanks again

    • Like 1
  4. 14 minutes ago, teppo said:

    Thanks!

    Currently "id", "name", and "title" are indexed automatically for page reference fields. If a programmatic approach is easy enough, you can modify this behaviour and add more fields by hooking before Indexer::getPageReferenceIndexValue() and modifying the $indexed_fields argument. Alternatively you could hook into this method and in specific cases replace the behaviour completely, for an example by returning the output of the indexPage() method for each individual page instead (here's a loosely related example).

    Let me know if you need additional pointers and I can provide some sample code.

    ok, I'm a noob but I'll give it a try. I will use my loops and add the needed content to the searchindex.
    But where should i place this hook to run it after a page is saved in the backend?

  5. hi @teppo, thanks for the module. it's great!

    i have pages which are selected through a page reference field from inside a table which is inside a repeater which is inside a repeater matrix item
    (matrix_repeater) -> (matrix_repeater_item)  -> (repeater) -> (table) -> (table column [page reference field]) -> title or text_field

    the search_index has already the title of those pages in it. is there an easy way to also get the other fields of the reference page inside the search_index. those selected pages have also a search_index.just to be sure you know where the pages are, here's the route i go on the frontend:

    	foreach($page->matrix_repeater as $matrix_repeater_item) {
    		if($matrix_repeater_item->type == 'xxxxx') {
    			foreach($matrix_repeater_item->repeater as $repeaterItem) {
    				foreach($repeaterItem->table as $tableRow) {
    					$selectedPage = $tableRow->pageReference;
    			        $selectedPage->title; // this is automatically in the search_index
    					$selectedPage->body	// this should be added to the search_index
    				}
    			}
    		}
    	}
  6. i need to search inside an table which is inside a repater which is inside a repeater matrix fiels
    so this is the structure:
     (matrix_repeater) -> (matrix_repeater_item)  -> (repeater) -> (table) -> (table column [page reference field]) -> title or text_field

    $matches = $pages->find("matrix_repeater.matrix_repeater_item.repeater.table.table_page_reference.title%=$q");
    

    is that even possible?

  7. Is there a way to search in a multilingual-site only through default language values?
    My selector for my other languages work like this:

    $selectorEn = "seo_description.data1032~=$q, limit=50, template!='pw_child'";
    $selectorFr = "seo_description.data1031~=$q, limit=50, template!='pw_child'";

    1032 is english and 1031 ist french and my default language ID is 1021.
    However this does not work

    $selectorDe = "seo_description.data1021~=$q, limit=50, template!='pw_child'";

    and this selector searches all languages

    $selectorDe = "seo_description~=$q, limit=50, template!='pw_child'";

    What i want is to search and get the results in different languages and show those results in the different languages.

  8. On 4/17/2020 at 2:53 PM, PK Mi43 said:

    Hello everyone,

    first of all thank you @joshua for your example with external media. Greatly appreciated.

    Right now i was tasked to integrate a Facebook Pixel onto a website. I assume i just do the same i did with Google Analytics and add the type/data-type/data-category "statistics" to the <script> tag. Easy!?

    What about the following part:

    
    <noscript>
      <img height="1" width="1" src="https://www.facebook.com/tr?id=yourfacebookid&ev=PageView&noscript=1"/>
    </noscript>

    Can/do i use the same procedure just with <noscript> instead of <script>, e. g.

    
    <noscript type="optin" data-type="text/javascript" data-category="statistics">

    or do i use the new (v0.0.5) implemented

    
    <img type="optin" data-category="statistics" data-src="https://www.facebook.com/tr?id=yourfacebookid&ev=PageView&noscript=1" width="1" height="1">

    without the <noscript></noscript> part?

     

    Thanks in advance for your help, again. Have a great weekend and stay safe.

    @joshua is there any solution for this?

     

     

  9. thanks @horst

    for js-beginners like me here is my solution:

    function eraseCookie(name) {
      document.cookie = name+'=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; Domain=.your-domain.tld;';  
    }
    
    var privacyWireCookies = JSON.parse(window.localStorage.getItem('privacywire'));
    
    if (privacyWireCookies !== null) {
      if(privacyWireCookies.statistics == false) {
      	eraseCookie("cookiename");
      }
    }

    Be aware that you have set the domain to be able to remove the cookies for google-analytics!

    • Like 1
  10. 47 minutes ago, joshua said:

    If enabled in the TextformatterPrivacyWire settings, yes.

    But it's disabled by default.

    Ok. Then i'm doing something wrong.
    I installed PrivacyWire and TextformatterVideoEmbed and added them both to my textarea-field as textformatters.
    After that i choosed ExternalMedia to as you suggest above.
    Now when i add a YouTube-Link inside my textarea and external-media-cookies are off, i still can see the Iframe.

    I also installed TextformatterVideoEmbedOptions and activated YouTube: Enable privacy-enhanced mode.

    All Modules are updated to newest version. 

  11. On 11/25/2020 at 5:59 PM, joshua said:

    @teppo Thanks alot for your PR with the TextformatterVideoEmbed integration! I tested and merged your PR today.

    I like the idea of adding more and more integrations with other modules like TextformatterVideoEmbed.

    @teppo & @joshua does this mean, that iframes generated via TextformatterVideoEmbed will use PrivvacyWite data-attributes and are hidden untill given consent?

     

  12. @joshua thx again.

    Works great for iframes.
    Is there also a solution to have it for external content which loads through scripts and divs. For example GoogleMaps. Right now i can do this:

    // this puts content into #myMap
    <script type="text/plain" data-type="text/javascript" data-category="external_media" data-src="gmaps.js"></script>
    
    <div id='myMap'></div>

    But unlike the your-iframe solution i cant have a ask-consent-button. It would be nice to have links like this integrated:

    <a href="#" class="privacywire-allow-category" data-category="external_media" data-ask-consent="0">Allow Cookies for external media</a>


     

  13. Hi @joshua

    i tried to have an iframe only be shown if consent is given.
    This is my code:

    <div data-category='external_media' data-ask-consent='0'>
    	<div class='video_content' >";
    		<iframe src='https://www.youtube-nocookie.com/embed/XXXXXXXXXX?enablejsapi=1' width='640' height='390' frameborder='0'></iframe>
    	</div>
    </div>

    If consent for external_media is not given, the module asks you to give consent. „To load this element, it is required to consent to the following cookie category: External Media.“ 
    But if consent is given, it does not show the div.video_content or the iframe. I tested to have some plaintext instead of the iframe and it works.

    So this works:

    <div data-category='external_media' data-ask-consent='0'>
    	<div class='video_content' >
    		<p>hello world!</p>
    	</div>
    </div>

    And it looks like as if  0 or 1 for data-ask-consent does not make any difference.

    UPDATE:
    my fault, this works!
     

    <div class='video_content' >";
    	<iframe src='' data-src='https://www.youtube-nocookie.com/embed/XXXXXXXXXX?enablejsapi=1' data-category='external_media' data-ask-consent='0' width='640' height='390' frameborder='0'></iframe>
    </div>

     

×
×
  • Create New...