Jump to content

Recommended Posts

Yes I confirm, I uninstalled the module and reinstalled again and the error gone, sorry for that.

Must have been a left over schema? That would be the only thing that explains it...

Share this post


Link to post
Share on other sites

Bumped to 1.5.2 - Fixes an issue pertaining to URL sanitization. If you used a period in a destination (tested only with "robots.txt"), the URL was sanitized, and "http://" was added. This issue is now fixed.

Using Git Gui now, instead of Desktop - it seems to prefer the fast-forward merge. Am using an older version, but it doesn't matter, really.

  • Like 1

Share this post


Link to post
Share on other sites

Not sure how this works...

If the source link has a language in it (en) then I want to redirect always to that language:

en/label/carl/ --> en/label/management/

Jumplinks does some autocorrection after save, and because I as a user have my profile language set as de (German), I see this:

en/label/carl/ --> de/label/management/

Did I set it up wrongly or is this something that goes wrong? (Google does not like cross-language linkings)

Share this post


Link to post
Share on other sites

Small ideas: 

  • I would love a lot if there was an "external-link" button before the Source string and the Target string. Clicking on it would send me to a new window with the page loaded (or not). So I can quickly test the Target (valid) and the Source (if the redirect applied is working).
  • I would like a dupe check - So the same string is not entered twice.
  • If I use the 404 monitor to fix a link the link should be removed from the 404 monitor so I do not fix it twice

Share this post


Link to post
Share on other sites

Hi ceberlin,
 

Not sure how this works...
 
If the source link has a language in it (en) then I want to redirect always to that language:
 
en/label/carl/ --> en/label/management/
Jumplinks does some autocorrection after save, and because I as a user have my profile language set as de (German), I see this:
 
en/label/carl/ --> de/label/management/
Did I set it up wrongly or is this something that goes wrong? (Google does not like cross-language linkings)

Jumplinks wasn't actually built with multi-language in mind. That said, I wouldn't have expected it to do this. Just to confirm, are you saying it changes en to de when you save the jumplink?

Small ideas: 

  • I would love a lot if there was an "external-link" button before the Source string and the Target string. Clicking on it would send me to a new window with the page loaded (or not). So I can quickly test the Target (valid) and the Source (if the redirect applied is working).
  • I would like a dupe check - So the same string is not entered twice.
  • If I use the 404 monitor to fix a link the link should be removed from the 404 monitor so I do not fix it twice
  1. I'm sure I can add a test button for the Source and Destination fields in the editor. The problem is that it would only be able to test Sources that do not contain wildcards. I could very well make it ask for input for each wildcard, but would that not be kinda tedious?
  2. Dupe-checking is on my to-do list
  3. The 404 monitor is being broken out into a separate module. Due to this, the plan is actually to have a little tick appear next to each 404 that has a jumplink assigned. There are often cases where one needs to keep the entries in order to obtain certain information about them. However, the module will have functionality similar to that of ProcessLogger, whereby the log can be pruned. The difference, however, will be that you can prune by different factors, including the removal of all 404 hits that have jumplinks assigned to them.

Share this post


Link to post
Share on other sites

Yes en is replaced with de on save (or maybe without any language path information and PW adds this later)

That the module does not handle languages is a surprise because I thought it did - South Africa alone has so many languages ;) )
 
OK, what I see: it keeps the paths at the source. If there is an /en/ in it stays there.
The target is "treated" somehow. It appears that it shows the path always in the language I use as a user.
If I change my user language, the target paths change. Not sure how the effects are if a bot comes. Probably always en or what I set as hreflang='x-default.
 
Test buttons: The idea was to have a quick possibility to check if the redirect is still needed and still valid.
I am used to this from a very good Wordpress plugin.
(That plugin is a very clever beast, by the way: http://codecanyon.net/item/seo-redirection-pro/7596396 it even has a history for any redirects made - which is usefull to track errors, if you have many redirects - on of our sites has 500 redirects)
 
I would not have a problem with wildcards are left out and the source button is inactive in that case.

Share this post


Link to post
Share on other sites

(1) Yes en is replaced with de on save (or maybe without any language path information and PW adds this later)

That the module does not handle languages is a surprise because I thought it did - South Africa alone has so many languages ;) )
 
(2) OK, what I see: it keeps the paths at the source. If there is an /en/ in it stays there.
The target is "treated" somehow. It appears that it shows the path always in the language I use as a user.
If I change my user language, the target paths change. Not sure how the effects are if a bot comes. Probably always en or what I set as hreflang='x-default.
 
(3) Test buttons: The idea was to have a quick possibility to check if the redirect is still needed and still valid.
I am used to this from a very good Wordpress plugin.
(That plugin is a very clever beast, by the way: http://codecanyon.net/item/seo-redirection-pro/7596396 it even has a history for any redirects made - which is usefull to track errors, if you have many redirects - on of our sites has 500 redirects)
 
I would not have a problem with wildcards are left out and the source button is inactive in that case.

(1) I think the original intent was for it to be language-agnostic - that said, specific wildcard/language features haven't been implemented. Haven't even though about how that would work - might be something to add to the todo list for v2. Yeah, 11 spoken language - there are sites in our native languages, but I've never had an African client ask for their website to be in their language in addition to English. Now that you bring it up, I'm actually quite surprised. ;)

(2) I think the following line may be the culprit. It comes from the compileDestinationUrl function (at line 309), which was recently changed.

$prefix = ($hasScheme) ? '' : "http{$https}://{$this->config->httpHost}{$this->pages->get(1)->url}";

So the pages->get(1)->url is the part that could be causing the issue... Not entirely sure (I don't use multi-language at all, so not sure on the behaviour).

(3) I'm not seeing the test buttons on that plugin - unless I'm just not looking properly... What would determine if a redirect is still needed? Currently, Jumplinks informs you of old redirects, those that haven't been hit in a while, and notifies you accordingly. And what would determine if it is still valid? I assumed that the intention was to have the test buttons make sure the jumplinks actually work as intended... No? (Forgive me if I've misunderstood...)

Share this post


Link to post
Share on other sites

I have pushed 1.5.3 to the dev branch, which does change that line to use the site root instead. Also finished converting over to PDO (no idea why this wasn't done sooner).

Work on Jumplinks 2 begins this weekend. Had a 'prototype' before, but it wasn't working out the way I'd intended (coding blues?), so starting again this weekend.

Share this post


Link to post
Share on other sites

(3)The buttons are there:

post-601-0-62546300-1454093099_thumb.png

Do you want to have access to a website where you can see the plugin in action? It's pretty advanced. Maybe it is inspiring for your new project?

I installed the beta from today:

I set this

post-601-0-93652500-1454093102_thumb.png

and still got this after save:

post-601-0-10393200-1454093101_thumb.png

The string that I had set manually "en/helium-vola/" had been replaced again by the page-id and ignoring the language.

If you touched that in the beta, the behavior is still unchanged...

Share this post


Link to post
Share on other sites

I think I see what's happening, though. When you manually specify the destination of an existing page without using the page tree or auto complete fields, Jumplinks actually converts it to a page selector (page:id). Because your currently language is German, the admin area will display the link to the page in that language. If you were to change your user language back to English, it would display that one instead.

The only way around this, I would think (though it is too early in the morning for me to be doing any thinking), is to allow you to instruct Jumplinks to not convert destinations that match existing pages to page identifiers. So, in the DB, it would remain as /de/something, instead of being converted to page:id.

For reference, the responsible process is this (in ProcessJumplinks.module.php):

// If the Destination Path's URI matches that of a page, use a page ID instead
if ($noWildcards && $isRelative) {
    if (($page = $this->pages->get('/' . trim($input->destinationUriUrl, '/'))) && $page->id) {
        $input->destinationUriUrl = "page:{$page->id}";
    }
}

So I simply need to change the behaviour so that the destination is only converted if the check box is selected. This does mean that I'd need to do a schema change, though.

Regarding that SEO plugin, I'd prefer it if I developed Jumplinks without looking at what other tools use and how they do so. If there is a specific feature (like the testing links) that is needed, I'm keen to implement my own version. But thanks for the offer. ;)

Share this post


Link to post
Share on other sites

Avoiding cross language linking are a big SEO topic. An option like the one you mentioned would be great. (And maybe that all is only needed if Languages are active (module installed, more than 1 language counted?) Or leaving it as it is and adding a language selector for the installed languages placed before the target link and shown for multilingual setups? - Just thinking loud.

 
What the module has and what I like is a very good search for links substrings on the source and target side (think of cases of 500+ redirections). And a debug option where every redirect is logged and shown the same way as 404 errors, with listing source and target for each incident. In case of redirect problems (first of all: loops) those information can be extremely valuable. And it has an optional cache.

Share this post


Link to post
Share on other sites

Have started with v2, which will incorporate a considerable change in architecture and features. It was advised early on to not bloat the module with too many things, but I'm going to go ahead and add a redirect logger, the testing buttons, and a few other things. Note, however, that much of this will be turned off by default so as to keep the module clean and simple.

Share this post


Link to post
Share on other sites

One more idea :-)

For testing and debugging malfunctioning redirects (redirects can come from so many sources, htaccess, PW core, modules) it would be great to being able to either deactivating the module temporarily (preferred) or to temporarily uninstall the module without loosing all the stored data.

  • Like 1

Share this post


Link to post
Share on other sites

One more idea :-)

For testing and debugging malfunctioning redirects (redirects can come from so many sources, htaccess, PW core, modules) it would be great to being able to either deactivating the module temporarily (preferred) or to temporarily uninstall the module without loosing all the stored data.

Added to the list of things to do. :)

  • Like 2

Share this post


Link to post
Share on other sites

Still on the topic about multilanguage URLs, I have the following use case:

It's a Wordpress site with the qTranslate plugin

Old url: example.com/books/book-details/25/

New url: example.com/books/title-of-the-book/ (it has a field called wpid that stores the old wordpress id)

The jumplink: 

Source: books/book-details/{id}[/] / Destination: [[template=book, wpid={id}]]

works for the default language, the problem is when I try to redirect to the non-default language, Portuguese:

Old url: example.com/pt/books/book-details/25/

New url: example.com/pt/books/title-of-the-book/

I got a 404 so I changed the rule to: 

<|pt/>books/book-details/{id}[/]

and it almost works, BUT only redirects to the default language.

Is there a way to keep the matched string ('pt/') in the redirect? Or something like:

Source: <|pt/>books/book-details/{id}[/] / Destination: [[template=book, wpid={id}, language=$user->language]]

Or is there other workaround?

Share this post


Link to post
Share on other sites

Hi Sergio,

I see your dillema indeed. The problem is that the destination selector is language-agnostic, or, doesn't give specific consideration to the language being requested by the end user. Adding language to the selector doesn't seem to be the way to go - though I haven't tried it at all (not very familiar with multi-lang at this point).

The only suggestion I could make is to deviate from using destination selectors (I know they're wicked and what not, but sometimes they're just not the beasts they want to be), and use mapping collections instead. In fact, I think it is more suited to the task. However, it should be noted that I haven't given Jumplinks the ability to have optional params ({segment?}, for example) as yet. So it would be a case of having a jumplink for the URIs without the lang code, and another with the lang code.

Source (without lang code): books/book-details/{id}/?

Destination: books/{id|wpbooks}/

Source (with lang code): {segment}/books/book-details/{id}/?

Destination: {segment}/books/{id|wpbooks}/

Mapping Collection named wpbooks:

1=foo
2=bar
n=baz

Sure, this is a tad tedious (two jumplinks where there could be one), but I think it's the safest and most reliable bet at this point.

I hope this works out for you. Of course, I'll be looking at all of this as I continue with JL 2. Optional parameters is something that has been on my mind once or twice. :)

  • Like 1

Share this post


Link to post
Share on other sites

Mike, thanks a lot for taking the time to reply. :)

Your solution worked! I thought something similar before posting, but decided to give it a shot. For these book pages, your approach is good indeed, as there are few books. But for my next challenge, mapping hundreds of download items to their new pages, my proposed solution would be handy. :) But for now I'll just create a script to generate the collection list for me. 

Cheers!

  • Like 1

Share this post


Link to post
Share on other sites

Perfect, Sergio. I think that I need to spend some time getting to fully understand how multi-lang sites work so I can attempt to incorporate support for them.

A quick thought that ran through my mind was this:

Source: /{lang}/books/book-details/{id}/?

Destination: [[template=book, wpid={id}], {lang}]

In the background, this would change the user language if it exists, get the URI, and then quickly change it back. ;)

({lang} would be a specific parameter, which would be allowed to be empty.)

That said, the syntax may change for JL 2... Not sure as yet.

  • Like 1

Share this post


Link to post
Share on other sites

I think this will work pretty good, Mike. And it will work for pages that are only published in one language as well. 

  • Like 1

Share this post


Link to post
Share on other sites

I think this will work pretty good, Mike. And it will work for pages that are only published in one language as well. 

Phew, the flexibility is overwhelming. ;) But yeah, that would be checked for.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Mike

I was just updating PW from 2.7.2 to 2.7.3 and have following error

Fatal error: Exception: Blueprint not found: /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/Classes/../Blueprints/schema-update-v1 (in /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/Classes/Blueprint.php line 61) #0 /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/Classes/Blueprint.php(40): Blueprint->findBlueprint('/../Blueprints/...') #1 /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/ProcessJumplinks.module.php(276): Blueprint->__construct('schema-update-v...') #2 /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/ProcessJumplinks.module.php(223): ProcessJumplinks->blueprint('schema-update-v...') #3 /var/www/vhosts/mysite.com/httpdocs/site/modules/ProcessJumplinks/ProcessJumplinks.module.php(192): ProcessJumplinks->updateDatabaseSchema() #4 /var/www/vhosts/mysite.com/httpdocs/wire/core/Modules.php(462): ProcessJumplinks->init() #5 /var/www/vhosts/mysite in /var/www/vhosts/mysite.com/httpdocs/index.php on line 252

Any advice? In the meantime I'm going to rewind a little back down to 2.7

Share this post


Link to post
Share on other sites

Hi Mike

I was just updating PW from 2.7.2 to 2.7.3 and have following error

Any advice? In the meantime I'm going to rewind a little back down to 2.7

Hi Peter,

I'm not sure why that is happening...

What version of Jumplinks do you have?

Share this post


Link to post
Share on other sites

How to deal with multi-language website ?

A client with a old website build with joomla

A multi-language url may look like for a same piece of content

content/blogcategory/19/34/lang,en/

content/blogcategory/19/34/lang,zh/

content/blogcategory/19/34/lang,gb/

How to redirect to different language of a pw site ?

Share this post


Link to post
Share on other sites

How to deal with multi-language website ?

A client with a old website build with joomla

A multi-language url may look like for a same piece of content

content/blogcategory/19/34/lang,en/

content/blogcategory/19/34/lang,zh/

content/blogcategory/19/34/lang,gb/

How to redirect to different language of a pw site ?

Hi adrianmak,

Well it depends where you are redirecting from. Does your Source contain anything relating to the language of the Destination?

Share this post


Link to post
Share on other sites

Does your Source contain anything relating to the language of the Destination?

I'm not sure how to set it up.

When specify a destination, it could only select a page from page tree or something like page:1017

1017 is the page id

but how to specify page id 1017 of other language ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By tcnet
      PageViewStatistic for ProcessWire is a module to log page visits of the CMS. The records including some basic information like IP-address, browser, operating system, requested page and originate page. Please note that this module doesn't claim to be the best or most accurate.
      Advantages
      One of the biggest advantage is that this module doesn't require any external service like Google Analytics or similar. You don't have to modify your templates either. There is also no Javascript or image required.
      Disadvantages
      There is only one disadvantage. This module doesn't record visits if the browser loads the page from its browser cache. To prevent the browser from loading the page from its cache, add the following meta tags to the header of your page:
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> How to use
      The records can be accessed via the Setup-menu of the CMS backend. The first dropdown control changes the view mode.

      Detailed records
      View mode "Detailed records" shows all visits of the selected day individually with IP-address, browser, operating system, requested page and originate page. Click the update button to see new added records.

      Cached visitor records
      View modes other than "Detailed records" are cached visitor counts which will be collected on a daily basis from the detailed records. This procedure ensures a faster display even with a large number of data records. Another advantage is that the detailed records can be deleted while the cache remains. The cache can be updated manually or automatically in a specified time period. Multiple visits from the same IP address on the same day are counted as a single visitor.

      Upgrade from older versions
      Cached visitor counts is new in version 1.0.8. If you just upgraded from an older version you might expire a delay or even an error 500 if you display cached visitor counts. The reason for this is that the cache has to be created from the records. This can take longer if your database contains many records. Sometimes it might hit the maximally execution time. Don't worry about that and keep reloading the page until the cache is completely created.
      Special Feature
      PageViewStatistic for ProcessWire can record the time a visitor viewed the page. This feature is deactivated by default. To activate open the module configuration page and activate "Record view time". If activated you will find a new column "S." in the records which means the time of view in seconds. With every page request, a Javascript code is inserted directly after the <body> tag. Every time the visitor switches to another tab or closes the tab, this script reports the number of seconds the tab was visible. The initial page request is recorded only as a hyphen (-).

      Settings
      You can access the module settings by clicking the Configuration button at the bottom of the records page. The settings page is also available in the menu: Modules->Configure->ProcessPageViewStat.
      IP2Location
      This module uses the IP2Location database from: http://www.ip2location.com. This database is required to obtain the country from the IP address. IP2Location updates this database at the begin of every month. The settings of ProcessPageViewStat offers the ability to automatically download the database monthly. Please note, that automatically download will not work if your webspace doesn't allow allow_url_fopen.
      Dragscroll
      This module uses DragScroll. A JavaScript available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability in view mode "Day" to drag the records horizontally with the mouse pointer.
      parseUserAgentStringClass
      This module uses the PHP class parseUserAgentStringClass available from: http://www.toms-world.org/blog/parseuseragentstring/. This class is required to filter out the browser type and operating system from the server request.
    • By Mike Rockett
      TextformatterTypographer
      A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more.
      It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC.
      The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
    • By robert
      I often had the need for an overview of all used fields and their contents for a specific page/template while developing new websites without switching to the backend, so I made a small module which lists all the needed information in a readable manner (at least for me):
      Debug Page Fields
      https://github.com/robertweiss/ProcessDebugPageFields
      It adds two new properties to all pages:
      $page->debugFieldValues – returns an object with all (sub-)fields, their labels, fieldtypes and values $page->debugFieldTypes – returns an object with all fieldtypes and their corresponding fields // List all values of a pages $page->debugFieldValues // List a specific field $page->debugFieldValues->fieldname // List all used fieldtypes of a page $page->debugFieldTypes I recommend using it in combination with Tracy Debugger, Ray, Xdebug etc. as it returns an object and is only meant for developing/debugging uses. 
      For now, the fieldtype support includes mostly fieldtypes I use in my projects, but can easily be extended by adding a new FieldtypeFIELDNAME method to the module. I use it with five different client installations (all PW 3.0.*), but of course there might be some (or more) field configurations which are not covered correctly yet.
      Supported fieldtypes
      Button Checkbox Color Combo Datetime Email FieldsetPage * File FontIconPicker Functional Image ImageReference MapMarker Multiplier Mystique Options Page PageIDs PageTitle Radio Repeater * RepeaterMatrix * RockAwesome SeoMaestro Table Text Textarea Textareas Toggle URL * The fields with complete subfield-support also list their corresponding subfields.
      Installation
      Download the zip file at Github or clone the repo into your site/modules directory. If you downloaded the zip file, extract it in your sites/modules directory. In your admin, go to Modules > Refresh, then Modules > New, then click on the Install button for this module. As this is my first ›public‹ module, I hope I did not miss any important things to mention here.
    • By horst
      Wire Mail SMTP

      An extension to the (new) WireMail base class that uses SMTP-transport

      This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times.

      The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only).
       
      Here are Ryans announcement.



      Current Version 0.6.0
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
      get it from the Modules Directory Install and Configure

      Download the module into your site/modules/ directory and install it.

      In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature.
      You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts.


      Usage Examples
      The simplest way to use it:
      $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient.
       
      You may also use the object oriented style:
      $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire:
      $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients.
      $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array:
      $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working:
      $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; }  
      A MORE ADVANCED DEBUG METHOD!
      You can add some debug code into a template file and call a page with it:
      $to = array('me@example.com'); $subject = 'Wiremail-SMTP Test ' . date('H:i:s') . ' äöü ÄÖÜ ß'; $mail = wireMail(); if($mail->className != 'WireMailSmtp') { echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; } else { $mail->from = '--INSERT YOUR SENDER ADDRESS HERE --'; // <--- !!!! $mail->to($to); $mail->subject($subject); $mail->sendSingle(true); $mail->body("Titel\n\ntext text TEXT text text\n"); $mail->bodyHTML("<h1>Titel</h1><p>text text <strong>TEXT</strong> text text</p>"); $dump = $mail->debugSend(1); } So, in short, instead of using $mail->send(), use $mail->debugSend(1) to get output on a frontend testpage.
      The output is PRE formatted and contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection, like this one:
       
      Following are a ...


      List of all options and features


      testConnection () - returns true on success, false on failures


      sendSingle ( true | false ) - default is false

      sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+)


      to ($recipients) - one emailaddress or array with multiple emailaddresses

      cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses

      bcc ($recipients) - one emailaddress or array with multiple emailaddresses

       
      from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here

      fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here


      priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest

      dispositionNotification () or notification () - request a Disposition Notification


      subject ($subject) - subject of the message

      body ($textBody) - use this one alone to create and send plainText emailmessages

      bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback)

      addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here
      (only available if a signature is defined in the config screen)

      attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename


      send () - send the message(s) and return number of successful sent messages


      debugSend(1) - returns and / or outputs a (pre formatted) dump that contains the areas: SETTINGS, RESULT, ERRORS and a complete debuglog of the server connection. (See above the example code under ADVANCED DEBUG METHOD for further instructions!)


      getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses,


      logActivity ($logmessage) - you may log success if you want

      logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly
       
       
      useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here

      sentLogReset ()  - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter

      sentLogGet ()  - is called automaticly within the send() method - returns an array containing all previously used emailaddresses

      sentLogAdd ($emailaddress)  - is called automaticly within the send() method
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
       
       
    • By Cybermano
      Food Allergens Module
      A simple List of Food Allergens
      My needs were to provide a simple list of food allergens for our clients with restaurant related activity.
      The idea was to simply output the list (to speed up the data entry) without leaving the food menu editing, eg. opening another page in new tab or window.
      This isn't a perfect solution, but it works fine for my needs and I decided to share the base idea.
      This could also be easily used to show little notes or short "vademecum", not only for the list of food allergens.
      ---
      Main features
      The basis
      All moves from a short editing of the module in this tutorial: How to create custom admin pages by @bernhard
      First of all it creates an empty admin page, with a dedicated permission to let safe-user to see it (this permission has to be created as a new ones, manually or by the module).
      Once the page is created, I have hooked its behaviour into the ready.php, to show the content (basically a list).
      A step further
      With the tips of  @bernhard, @Soma (and many others), see here , the magic happens. 
      The new page will be shown as a panel, so editors will not abandon their data entry to have a quick view to the list.
      A little further
      Why scroll to the top of the page to click a link?
      The next step was to create a sticky button only in the food menu pages.
      Again with a @bernhard tip I moved into the customization of this simple module and the related hook.
      ---
      How to use this module
      After installed, it creates the page /admin/page/allergens/ and the module is to be setted up. The first field is a CKEditor with multi-language. This is the place where to write the informations that will be shown into the page. The next field is a simply text-area where to place a bit of JS that will be appended to the markup of the text (omit the 'script' tags). I also putted a checkbox with a silly statement: this to think at least twice on the safety of the written JS. Now comes the first way to display the link to the page
      Field Note with Link. Enable and save it. The module will display a new row with 4 selects (1 standard and 3 ASM):
      View mode (to show the page as Panel or as Modal PopUp); Templates to select: select one or more and save before proceed, so the  asm-select of the pages will be populated showing all the pages of the selected templates. Pages to select: also here select at least one and save before proceed to populate the asm-select for fields only with the ones that belong to the selected pages. Select the fields where to place the note and save again. That's all: now you will find into the notes of the selected fields the link "See the List of Allergens".
      At the same way, the option for the sticky button, but with a plus
      The field select is obviously unnecessary, but you could play with the last row: the inline styles to fix your sticky button where you like. Here you could set the sticky position of the <div> and the absolute ones of the <a>.

      Video Explanation
      In these screencasts you could see a custom JS that show a "copy" button near a "hanna-code" call.
      This because I've set a specific one for each allergen to show up a tooltip in the front end.

      Registrazione #33.mp4  

      Registrazione #34.mp4 ---
      Last but not the least
      Actually it works fine for my needs, even if it's much improvable: I'm working on the permissions creation, the uninstall section, a separate configs and defaults and how to include the hook into the module leaving free the ready.php. According to a simpler uninstall. Also I would make the link text as a dynamic text field, so it will be more flexible.
      I always learn a lot here, so I would share my code for whom it could be interested.
      I removed the hanna code references, but I provide you the html list of the allergens, English and Italian too, so you can paste them into the "source" of the CKEditor field to have a ready to use module.
      Obviously you are free to modify the code as per your needs.
      Please, keep in mind that I'm not a pro coder and I beg your pardon for my verbosity (speaking and coding). 😉
      I hope be helpful or for inspiration.
      Bye
      ready.phpList-ITA.htmlList-ENG.htmlAllergens.module
      README.md
×
×
  • Create New...