Jump to content

OllieMackJames

Members
  • Posts

    356
  • Joined

  • Last visited

Everything posted by OllieMackJames

  1. @LostKobrakai Thanks, that looks like just the thing!
  2. I have one site that is replicated across a number of sites. They all use the same fields, repeaters, templates etc. Now when I change or add things - functionalityonly - NOT content - to one site, how can I replicate all changes to all sites. To be clear, this has nothing to do with content, but only with templates, css, js, fields, repeater fields etc. How can I set one site to be the mother site and once changes are made there, I can roll those out to all the other sites that use the same templates, etc? Help and insight much appreciated Thanks
  3. Great idea, also for use with the soon expected promailer module. Here is a pdf with a list of disposable domains disposable-email-domains.pdf
  4. OK, solved, I copied the html to a file called nav.inc, then added this code to the template: <?php if ($page->landingpage !== 1) include ('nav.inc'); ?> That did the trick. Thanks
  5. @dragan thanks, but I don't understand yet, I tried the following but then the front end throws errors. <?php if ($page->landingpage !== 1) echo ([ <!-- Top Navigation Bar --> <div class="site-nav"> <div id="navcontrol" class="logobanner centered original-nav"> <label for="navtoggle" class="navtoggle"><img src="/site/templates/img/logo.png" width="196" alt="logo" title="Menu Toggle" alt="Menu Toggle"><span class='menu-toggle-text'><?=$menu_title?></span></label> </div> <input type="checkbox" id="navtoggle"/> <div class="top"> <nav class="original-nav"> <div id="logoline" class="logobanner logobanner-original centered"> <a href='/'><img src="/site/templates/img/logo.png" width="<?=intval($config->navLogoWidth)?>" alt="logo" style="max-width:<?=intval($config->navLogoWidth)?>px"></a> </div> <ul class="menu"> <!--?= renderNav($page); ?--> </ul> </nav> </div> </div> ]);
  6. In my template I want to exclude some html based on a field being checked. The field landingpage is a checkbox field, and if it is checked I want to exclude the html below from showing up, how can I do that? Thanks! <?php if $page->landingpage=1; //If the checkbox field landingpage is checked I want to exclude the following html code: <!-- Top Navigation Bar --> <div class="site-nav"> <div id="navcontrol" class="logobanner centered original-nav"> <label for="navtoggle" class="navtoggle"><img src="/site/templates/img/logo.png" width="196" alt="logo" title="Menu Toggle" alt="Menu Toggle"><span class='menu-toggle-text'><?=$menu_title?></span></label> </div> <input type="checkbox" id="navtoggle"/> <div class="top"> <nav class="original-nav"> <div id="logoline" class="logobanner logobanner-original centered"> <a href='/'><img src="/site/templates/img/logo.png" width="<?=intval($config->navLogoWidth)?>" alt="logo" style="max-width:<?=intval($config->navLogoWidth)?>px"></a> </div> <ul class="menu"> <!--?= renderNav($page); ?--> </ul> </nav> </div> </div>
  7. OK, got it to work with the following code, don't know why, as I am not a coder, but hey it works, posting solution for anyone who wants to use it. Added following code to template function visitorgroup($which = null) { $ip = wire('session')->getIP(); $int = ip2long($ip); $group = ($int % 2) ? 'a' : 'b'; if(is_null($which)) return $group; return $group == $which; } if(visitorgroup('b')): if($page->id == 1 && $page->page2use4homepage) { $page = $page->page2use4homepage;} endif; if($page->id == 1 && $page->page2use4homepage) { $page = $page->page2use4splittest;}
  8. @Zeka just tested and the following does not seem to work: function visitorgroup($which = null) { $ip = wire('session')->getIP(); $int = ip2long($ip); $group = ($int % 2) ? 'a' : 'b'; if(is_null($which)) return $group; return $group == $which; } I have added the above code to my _funcs.php which is called in my template with: require_once "_funcs.php"; Then straight after that line, in the same template I add: if($page->id == 1 && $page->page2use4homepage) { if(visitorgroup('a')): $page = $page->page2use4homepage; elseif: $page = $page->page2use4splittest; But then I get this error Server Error We're sorry! The server encountered an internal error and was unable to complete your request. Please try again later. I also tested with all of your code in one go in my template, did not work either: function visitorgroup($which = null) { $ip = wire('session')->getIP(); $int = ip2long($ip); $group = ($int % 2) ? 'a' : 'b'; if(is_null($which)) return $group; return $group == $which; } if($page->id == 1 && $page->page2use4homepage) { if(visitorgroup('a')): $page = $page->page2use4splittest; elseif: $page = $page->page2use4homepage; Thanks!
  9. @Zeka many thanks! Am now going to test this. @Soma moved, ok thanks
  10. @zeka, thanks for that! Analytics route for CallToAction measurement, makes good sense, thanks getkirby splittest plugin looks good, I wonder how to port this to Processwire. I copied the code below from https://getkirby.com/docs/cookbook/a-b-testing. Question now is... How can I turn it into Processwire language and then make into a plugin?: function visitorgroup($which = null) { $ip = visitor::ip(); $int = ip2long($ip); $group = ($int % 2) ? 'a' : 'b'; if(is_null($which)) return $group; return $group == $which; } Then if that works I would add something like this to the template: if($page->id == 1 && $page->page2use4homepage) { if(visitorgroup('a')): $page = $page->page2use4homepageoption1; elseif: $page = $page->page2use4homepageoption2; Any ideas how to do this? Thanks
  11. Thanks to @Zeka for helping out. I am not a coder and had to tinker some to make it work, but hey it works! The code below allows splittesting 2 pages against each other. Visitors will be divided in 2 groups based on their IP. Measuring clicks to be done via analytics software. Concern might be lack of speed of loading, because this can not be cached, I have no data yet regarding loss of speed of delivery of pages, but will check. This is the code that does the trick: function visitorgroup($which = null) { $ip = wire('session')->getIP(); $int = ip2long($ip); $group = ($int % 2) ? 'a' : 'b'; if(is_null($which)) return $group; return $group == $which; } if(visitorgroup('b')): if($page->id == 1 && $page->page2use4homepage) { $page = $page->page2use4homepage;} endif; if($page->id == 1 && $page->page2use4homepage) { $page = $page->page2use4splittest;} Here's what I would like to do: - divide traffic over 2 versions of a page - measure clicks on a call to action button to see which page gives a better conversion. I already have a system in place to pull data from a different underlying page into one page, I do it with this code: if($page->id == 1 && $page->page2use4homepage) { $page = $page->page2use4homepage; The code above allows me to change a page while keeping the original intact, I went this route because I found on one of my sites after changing a page, I lost rankings in google, and needed a way to change a page, and with one click go back to the original. But now I want to use this dynamic in a different way for splittesting conversions on one page. Let me write down what I would like to happen in the code above: if($page->id == 1 && $page->page2use4homepage) { function count CallToActionClicks for each of the options below count clicks on CallToAction button; function dividetraffic for 50% of the traffic present $page = $page->page2use4homepage version 1; for the other 50% of the traffic present $page = $page->page2use4homepage version 2; Any ideas much appreciated, thanks!
  12. following this, very interested in a visual pagebuilder Good work guys!
  13. Nice! Very interested in your padloper/mollie combination looking forward to your open sourcing of the payment module you built.
  14. @wbmnfktr thanks lots, if I could get that to work, that would make me happy! This works beautifully [[jumplinks for=h2]] with your code did it all in one go! I tried the following code, but it would not work, can you see where I went wrong? <?php // $for defines the headlines you want to take care of. // i.e.: h2, h3, h4 $for = str_replace('h2', 'h3', $for); $for = explode(' ', $for); foreach($for as $k => $v) $for[$k] = trim($v); $for = implode('|', $for); $anchors = array(); $value = $hanna->value; if(preg_match_all('{<(' . $for . ')[^>]*>(.+?)</\1>}i', $value, $matches)) { foreach($matches[1] as $key => $tag) { $text = $matches[2][$key]; $anchor = $sanitizer->pageName($text, true); $anchors[$anchor] = $text; $full = $matches[0][$key]; $value = str_replace($full, "<a name='$anchor' href='#'></a>$full", $value); } $hanna->value = $value; } if(count($anchors)) { echo "<ul class='jumplinks'>"; foreach($anchors as $anchor => $text) { echo "<li><a href='$page->url#$anchor'>$text</a></li>"; } echo "</ul>"; } else { echo ''; } @bernhard thanks, I prefer not to go the route of repeaters here, as I just want to write the article and use h2 and h3 headers and then let Hanna deal with it. But thanks for chiming in, much appreciated.
  15. SOLVED - Thanks to @wbmnfktr for pointing out that this was already made possible with Hanna code, big thanks therefore to @ryan who even gave this as a working example of what could be done with Hanna code. Man this forum is awesome, this CMS is awesome, and now my site gets one step closer again to awesome for my visitors as well, thanks all! Leaving the original question below in case someone searches the forum for this exact same thing. ===========================original question below============================ I need a way to automate getting a table of contents on a really long page that I write. The sections on the page that need to end up in the TOC all have h2 headers. So I need the TOC module to loop through the page and take every instance of a h2 header and use that to buld the toc with clickable links to that particular h2 header Anybody have an idea how to do this? SOLVED
  16. I am trying this out in a json-ld setting and running into some trouble. For json-ld I need the content of the whole article om any give page. On this particular site we build pages with different fields, including matrix repeater fields. 2 problems, I see lots of markup like h2, span etc in the output, and the matrix repeater fields are not taken into consideration at all. What I need is the unformatted output of all the individual fields, including from the repeater matrix to show up in a concatenated field. Thanks!
  17. OllieMackJames

    Ekzaga

    I like what you did with the homepage, asking people what they want to trade, and then based on their answer you show the next question etc. Can you perhaps explain how you did that? Nice work!
  18. Thanks, that should get me going. Much appreciated!
  19. I have a site that exists since 2003, but has been on different platforms, html, modx and then processwire. And then on processwire we also migrated the site to a whole new design, which meant we started from scratch and imported some stuff. As a result my created and published dates are all over the place and not showing the history of the site. OK what is my question? How can I (re-)set the published and created dates for individual pages. Par example the homepage is created in 2003, but since the redesign of the site in 2015 proceswire now says the homewpage was created and published in 2015, but that is not true of course. Hence I want to set the created and published date back to the start of the site and then show the last modification to the page via datemodified. Anybody know how and where to set the published and created dates? Thanks.
  20. @Robin S and I thought it couldn't get any better and now you improve it again! Just tested it and it works, THANKS.
  21. @zoeck Thanks and how would I get what I want with $mypage code then? I believe when I use $mypage then I would need to change all templates to use $mypage in stead of $page and this way I can keep everything as it is, and just when I need it, I can swap the homepage, while even keeping the actual content on the page with id=1 unchanged. Maybe I want to check conversions to see which page converts better. I built my sites to generate action and my designers tell me that my pages are way too long, but hey I tested short and long and the longer pages until now ALWAYS outperformed the shorter pages. I tested design and found that design does not make much difference at all. It is the text and the flow of the text that makes all the difference. I tested video and found that text pages still outperform my videosalespages, but videos strategically placed elsewhere have doubled my conversions on my salespage. So the code below does just what I need, spot on, what can be wrong about that? /* fill in pageid of page to be used for content homepage*/ if($page->id == 1 && $page->page2use4homepage) { $p = $page->page2use4homepage->id; $page = $pages($p); } When I don't want to use the contents of the homepage, I just take the contents of another page. And whether that is good or not all depends on what one wants to do and to me this is the exquisite beauty of Processwire. It totally allows me to do what I feel is needed at any moment, even if that goes against the grain of what others consider not good. Like I said in my other post, there are definite reasons why I want to do this, it allows for using a homepage on a live site, then changing the underlying page that is used to pull content into the homepage. And the code above works like a charm! And what I also like about processwire is this wonderful forum, where people and help each other, so @zoeck , @kongondo, @louisstephens big thanks for taking out of your time and helping me, much appreciated.
  22. Whether I like it or not, I have to deal with this nonsense. Small sites have been fined in my country already for not having clear refund policies par example. What I do is have a contract with a third party who keeps all legal stuff for websites that are working in the EU up to date to EU laws. They tell me what kind of legal pages, privacy statements etc. etc. to have in place. They are also now working on checking what to do with the new privacy regulation. Once they have that ready, I'll just add or adjust what I currently have on my site. Of course this is not for free, but 80 euros or something around that order, is not too bad for some peace of mind. This is what I work with: https://www.webwinkelkeur.nl/ it is a Dutch site.
  23. OK, thanks all, I finally got it working, this is how I managed to do it: /* fill in pageid of page to be used for content homepage*/ if($page->id == 1 && $page->page2use4homepage) { $p = $page->page2use4homepage->id; $page = $pages($p); } Thanks all.
  24. @kongondo thanks for your thoughts and no offence taken - the opposite I value your and anybodies input and just realize I am not good at explaining what I want to do. For reasons mentioned in I DEFINITELY do want to use this code and am using it as below now, but hardcoded, so each time I want to change it I change the code in the template, but I want to do that without touching the template itself: /* fill in pageid of page to be used for content homepage*/ if( $page->id == 1 ) { $page = $pages(1213);} So that is why I want to specify the pageID, in this case 1213 on the homepage admin side via the field page2use4homepage. And I want the double if statement like mentioned in the first post. Let me try and explain it again: If this page is the homepage AND if the field page2use4homepage is filled THEN $page = $pages(get value from homepage-field-page2use4homepage and insert here) Hope that makes sense. I am aware this might go against what others consider done or not done, but hey, this is what I want to do so if anyone can tell me how to get the content of that field on the homepage into the code, great! So if I can invite anyone to just focus your coding smarts on how to make this happen, that would be great!
×
×
  • Create New...