ngrmm
-
Posts
421 -
Joined
-
Last visited
-
Days Won
3
Posts posted by ngrmm
-
-
here are some solutions:
-
@joshua what do you think about the idea to have a style.css file instead of the styling inside your js?
-
@joshua thanks for the module.
would you consider changing the header tag into a div?<header class="privacywire-header">…</header>
Some might using page header in their css-files without a class. It might get into style conflicts. What do you think?
- 1
-
3 minutes ago, MoritzLost said:
@ngrmm Yes, you can set regular cookies as mentioned in my first paragraph, though they won't be accessible through ProcessWire's $session API.
But why would you load 87kB of library bloat for something that you can do in one line? ?
you're right. I'll use the localStorage and hide/minify the modal with js/css if modal is dismissed.
- 1
-
i found a solution here: https://processwire.com/blog/posts/pw-3.0.141/
as ryan writes, you can use this script to set a cookie in javascript:
https://github.com/processwire/processwire/blob/master/wire/modules/Jquery/JqueryCore/jquery.cookie.js -
My clients wants a modal to show up on every page. But when a user clicks inside the modal -> a session-cookie is set and the modal gets a class.
// user clicks on modal button $('.modal_button').click(function(){ // 1. set PW session cookie // 2. toggle class $('.modal').toggleClass('off'); });
I know how to set a cookie on page-load via PW-API. But the click on the modal button does not force a page-load. So i have to set the cookie through javascript. Is there a way to do that?
-
What do i need to change in the Module-file to change the outout from
<iframe … src="https://www.youtube.com/embed/XXXXXXXX"></iframe>
to
<iframe … src="https://www.youtube-nocookie.com/embed/XXXXXXXX"></iframe>
I need to do this because data protection GDPR
-
On 9/17/2020 at 3:24 PM, David Karich said:
Unfortunately I cannot reproduce the problem at all. Please try the new version. Otherwise I can only imagine that the module collides with the JS code of another module. Maybe you can give me access to a test system so I can have a look at it.
i send you a pm
- 1
-
search for array chunk.
you could divide all your blog-posts into segments with five posts. and add a work sample add the end of the segment
-
@Robin S was very kind and had a deeper look at my problem and found the problem:
QuoteI took a look and it seems that the Custom Paths module is incompatible with the core LanguageSupportPageNames module. LanguageSupportPageNames also hooks Page::path and performs redirects before pages are viewed (not sure how it works exactly), and so it might be that there's no way for these two modules to function together.
- 1
-
@Robin S thanks for the Module.
I installed the module and added it to my template.
But it looks like PagePathHistory is overwriting the new custom path.my old path:
/test/folder/page/
new custom path
/test/page/
When i enter domain.com/test/page/, the site redirects me to the old path.
Did i forgot something? -
On 8/20/2020 at 10:39 AM, joshua said:
I had the same problem recently and discovered the bug: When there also is a normal Repeater field above the RepeaterMatrix field, the js bug occured.
You could try, if this version works for you. If so, I'll create a PR
@joshua thx. I tried it, and does not work for me. i also have not another repeater-field above or below my matrixfield.
-
@David Karich i remember using this module and everything was fine. I wanted to use it again but the copy icon doesn't show up anymore after installing the module. am i missing something?
pw 3.0.148 and tested with matrixrepeater v4 and v5 -
thx @dragan
this works
if($allguests->has("id=$input->urlSegment1")) { }
but i'll do it like you suggested. first sanitizing.
-
i have a event-page with a table.
first column in this table is page-reference-fieldhow can i find out if a urlSegment matches one of the rows having the same page-reference-field (page-id)?
// all guests $allguests = new pageArray(); foreach($page->event_guests_table as $event_guests_table_row) { $allguests->prepend($event_table_row->guest); } // echo allguests would output: 1101|1102|1103|… // domain.tld/event/1101/ // show content if guest is in the table or redirect if($input->urlSegment1 ~= $allguests ) { // show content } else { // redirect }
which selector operator do i have to use? the one above does not work
-
i bypassed it with a static helper-array and it works.
would be nice to know how to do this without a helper array$mNames = array("zero", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); $ms = wireArray(); $m1 = date('n', 1579643232); // 1 $m2 = date('n', 1583107200); // 3 $ms->prepend($m1); $ms->prepend($m2); foreach($ms as $name) { echo "$mNames[name] "; } // result: Januar März
-
I want to have filters with month names in german. I fetch them from date-fields with strftime('%B', $timestamp);
But i'm not able to add them correctly to a wireArray()What's the right way to do that?
$ms = wireArray(); $m1 = strftime('%B', 1579643232); // Januar $m2 = strftime('%B', 1583107200); // März $ms->prepend($m1); $ms->prepend($m2); foreach($ms as $name) { echo "$name "; // result: Januar M�rz }
-
4 minutes ago, guy said:
just updated to v1.1.4 with the bug fix
thx
it's weird, maybe i try mailgun and see what happens there
-
hi @guy
i corrected that comma on line 132still getting no statistics/activity-data on sendgrid. maybe its like this because of SSL (https)?
-
-
hey @guy
i installed this module and have a free-sendgrid account. generated an API key and did this:
$m = new wireMail(); $m->body('hello'); $m->from($email = 'test@test.com', $name = 'John'); $m->to($email = 'mail@test.com', $name = 'Jane', $substitutions = null, $subject = 'TESTING'); $m->___send();
Email is send out and delivered. But i don't see any statistics about them being sent on sendgrid. Did i forgot something?
Tracking is enabled. -
Got it working by using two loops. One for sending out emails and the other for changing the value.
… // loop through table and send out emails foreach($event->event_clients_list as $event_table_row) { // get client page $clientPage = $event_table_row->client_name; // get client email $clientEmail = $clientPage->email; // email html body ob_start(); include('./_inc/emailbody.inc'); $emailBody = ob_get_clean(); if($event_table_row->client_invited == '') { // send email $m = new WireMail(); $m->to($clientEmail); $m->from($fromEmail, $fromName); $m->subject($emailSubject); $m->bodyHTML($emailBody); $m->send(); } } // make event-page editable $event->of(false); // loop through table and change value foreach($event->event_clients_list as $event_table_row) { // if client isn't invited yet (checkbox not checked) if($event_table_row->client_invited == '') { $event_table_row->client_invited = 1; $event->save('event_clients_list'); } }
-
thank you @rick
it works!here the code:
// event ID $eventID = $input->get('eventID','int'); $event = $pages->get($eventID); // config $testEmail = $event->event_mail_test_adress; $fromEmail = $event->event_mail_from; $fromName = $event->event_mail_from_name; $emailSubject = $event->event_mail_subject; $filenameDate = strftime('%d-%m-%Y', $event->date_start); // filename $filename = "{$event->name}_{$filenameDate}"; // create ics file $file = fopen('ics/'.$filename.'.ics', 'w') or die('File can not be saved!'); // fetch start date $event_start_ts = $event->getUnformatted("date_start"); // build the .ics data $ical_data = "\r\n"; $ical_data .= 'BEGIN:VCALENDAR'; … … … $ical_data .= "\r\n"; $ical_data .= 'END:VCALENDAR'; fwrite($file, $ical_data); fclose($file); // HTML BODY ob_start(); include('./_inc/emailbody.inc'); $emailBody = ob_get_clean(); // send email $m = new WireMail(); $m->to($testEmail); $m->from($fromEmail, $fromName); $m->subject($emailSubject); $m->bodyHTML($emailBody); $m->attachment('ics/'.$filename.'.ics'); $m->send();
- 1
-
41 minutes ago, rick said:
Where does filename come from?
header("Content-Disposition: attachment; filename={$filename}.ics");
Why are you assigning an attachment that is not a file.
$m->attachment($ical_data);
Is the attatchment boundary defined ?
Filename is a $page->name
Sorry, i'm not an expert. What kind of headers do i need? And how do i define a boundery?
Is there a manual how to that?
PrivacyWire - Cookie Management & async external asset loading
in Modules/Plugins
Posted · Edited by ngrmm
solved
Hi @joshua
i tried to have an iframe only be shown if consent is given.
This is my code:
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:
And it looks like as if 0 or 1 for data-ask-consent does not make any difference.
UPDATE:
my fault, this works!