Nico Knoll

MarkupSEO - The all-in-one SEO solution for ProcessWire.

Recommended Posts

7 minutes ago, tpr said:

I guess you could check $page->seo->description and if it's empty, set it to your likings, eg. in ready.php or in your template php file (latter untested).


if($page->seo_description === "") {
	$page->seo_description = 'whatever';
}

 

Thank you for the answer.

The problem is, that i activated the "automatically" method to insert the code on my page. And the module inserts the empty description metatag anyway.

I don't know, if your code example will help me in this case?

Share this post


Link to post
Share on other sites

Just fast from mobile....

You have to use a hook on pagesave and check the SEO fields there....I ve some functions for creating keywords and description from some given fields... May tomorow I can post an example...

Share this post


Link to post
Share on other sites
On 31.7.2017 at 0:29 PM, tpr said:

It should.

YES! It works!
Thank you very much!!!

I unchecked the option "smart description" an add the code below in my template.

<?
    if($page->seo_description === "") {
       // Remove HTML tags
       $description = strip_tags($page->mytext);

       // Remove linebreaks
       $description = preg_replace( "/\r|\n/", " ", $description );

       // Shorten text
       $description = substr($description, 0, 160)." …";

       // Set new metadescription
       $page->seo_description = $description;
    }
    ?>

 

Share this post


Link to post
Share on other sites

Ok great that it works for you....a more complex solution with a hook on saveReady if SEO fields are empty put some own magic in there....if tey not empty do nothing...

functions that i use:

Spoiler

/**
 * Wordlimiter cuts a textarea only after complete words not between
 * used in admin.php for seo function and in some templates
 */
function wordLimiter($str = '', $limit = 200, $endstr = '...'){

	if($str == '') return '';

	if(strlen($str) <= $limit) return $str;

	$out = substr($str, 0, $limit);
	$pos = strrpos($out, " ");
	if ($pos>0) {
		$out = substr($out, 0, $pos);
	}
	$out .= $endstr;
	return $out;

}

/**
 * Alternative with regex for striptags function
 * used in admin.php for seo function and in some templates
 */
function ripTags($string) {

    // ----- remove HTML TAGs -----
    $string = preg_replace ('/<[^>]*>/', ' ', $string);

    // ----- remove control characters -----
    $string = str_replace("\r", '', $string);    // --- replace with empty space
    $string = str_replace("\n", ' ', $string);   // --- replace with space
    $string = str_replace("\t", ' ', $string);   // --- replace with space

    // ----- remove multiple spaces -----
    $string = trim(preg_replace('/ {2,}/', ' ', $string));

    return $string;

}
      
/**
 * Finds all of the keywords (words that appear most) on param $str
 * and return them in order of most occurrences to less occurrences.
 * @param string $str The string to search for the keywords.
 * @param int $minWordLen[optional] The minimun length (number of chars) of a word to be considered a keyword.
 * @param int $minWordOccurrences[optional] The minimun number of times a word has to appear
 * on param $str to be considered a keyword.
 * @param boolean $asArray[optional] Specifies if the function returns a string with the
 * keywords separated by a comma ($asArray = false) or a keywords array ($asArray = true).
 * @return mixed A string with keywords separated with commas if param $asArray is true,
 * an array with the keywords otherwise.
 */
function extractKeywords($str, $minWordLen = 5, $minWordOccurrences = 2, $asArray = false)
{
	function keyword_count_sort($first, $sec)
	{
		return $sec[1] - $first[1];
	}
	$str = preg_replace('/[^\p{L}0-9 ]/', ' ', $str);
	$str = trim(preg_replace('/\s+/', ' ', $str));

	$words = explode(' ', $str);
	$keywords = array();
	while(($c_word = array_shift($words)) !== null)
	{
		if(strlen($c_word) < $minWordLen) continue;

		$c_word = strtolower($c_word);
		if(array_key_exists($c_word, $keywords)) $keywords[$c_word][1]++;
		else $keywords[$c_word] = array($c_word, 1);
	}
	usort($keywords, 'keyword_count_sort');

	$final_keywords = array();
	foreach($keywords as $keyword_det)
	{
		if($keyword_det[1] < $minWordOccurrences) break;
		array_push($final_keywords, $keyword_det[0]);
	}
	return $asArray ? $final_keywords : implode(', ', $final_keywords);
}

 

the hook itself works in admin.php under site/templates/:

Spoiler

/**
 * Hook for changing seo_* fields if empty on Page Publish
 */
$pages->addHookAfter('saveReady', null, 'changeSeoFields');
function changeSeoFields(HookEvent $event) {
    $page = $event->arguments[0];
    //for this template only
    if($page->template == 'artikel'|| $page->template == 'seite') {
        // page is about to be published
        if($page->isChanged('status') && !$page->is(Page::statusUnpublished)) {
            // check if seo_title fields are exist and if they are empty
            if (!$page->seo_title) {
                //get the default value that would used as fallback
                if ($page->headline) {
                    //Headline field is used for seo_title
                    $default_title = ripTags($page->headline);
                } else {
                    //Headline field empty - page title is used
                    $default_title = ripTags($page->title);
                }
                //set seo_title on publishing
                $page->set ('seo_title', $default_title);
            }
            // check if seo_description fields are exist and if they are empty
            if (!$page->seo_description) {
                //get the default value that would used as fallback
                if ($page->kurztext) {
                    $default_desc = ripTags($page->kurztext);
                } else {
                    //is there a main content block as pagetable field pt_inhalt?
                    if(count($page->pt_inhalt)>0) {
                        //get the first text field in the pagetable and use it for the seo description
                        $first_item = $page->pt_inhalt->get("template=part_text|part_text_image_left|part_text_image_right|part_text_spalten");
                        $first_content = ripTags($first_item->text);
                        $default_desc = wordLimiter($first_content, 160);
                    }
                }
                //set seo_description on publishing
                $page->set ('seo_description', $default_desc);
            }
            // check if seo_keywords fields are exist and if they are empty
            if (!$page->seo_keywords) {
                //get the string that should be used to generate automatical keywords for this page
                //we use all textfields in the pagetable from the main content and collect them
                $keyword_texts = '';
                //is there a main content block as pagetable field pt_inhalt?
                if(count($page->pt_inhalt)>0) {
                    foreach ($page->pt_inhalt as $keyword_text) {
                        if ($keyword_text->title) $keyword_texts .= $keyword_text->title;
                        if ($keyword_text->text) $keyword_texts .= $keyword_text->text;
                        if ($keyword_text->text2) $keyword_texts .= $keyword_text->text2;
                        if ($keyword_text->text3) $keyword_texts .= $keyword_text->text3;
                    }
                } else {
                    $keyword_texts = $page->headline.' '.$page->kurztext.' '.$page->title;
                }
                //rip tags
                $keyword_string = ripTags($keyword_texts);

                $default_keywords = extractKeywords($keyword_string);

                //set seo_title on publishing
                $page->set ('seo_keywords', $default_keywords);
            }
        }
    }
}

 

As always it is not the best PHP code since im no professional....but it works for me....if i somedays get some time i could add something like that with optionfields to the module itself. ;)

Best regards mr-fan

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, mr-fan said:

Ok great that it works for you....a more complex solution with a hook on saveReady if SEO fields are empty put some own magic in there....if tey not empty do nothing...

functions that i use:

  Hide contents


/**
 * Wordlimiter cuts a textarea only after complete words not between
 * used in admin.php for seo function and in some templates
 */
function wordLimiter($str = '', $limit = 200, $endstr = '...'){

	if($str == '') return '';

	if(strlen($str) <= $limit) return $str;

	$out = substr($str, 0, $limit);
	$pos = strrpos($out, " ");
	if ($pos>0) {
		$out = substr($out, 0, $pos);
	}
	$out .= $endstr;
	return $out;

}

/**
 * Alternative with regex for striptags function
 * used in admin.php for seo function and in some templates
 */
function ripTags($string) {

    // ----- remove HTML TAGs -----
    $string = preg_replace ('/<[^>]*>/', ' ', $string);

    // ----- remove control characters -----
    $string = str_replace("\r", '', $string);    // --- replace with empty space
    $string = str_replace("\n", ' ', $string);   // --- replace with space
    $string = str_replace("\t", ' ', $string);   // --- replace with space

    // ----- remove multiple spaces -----
    $string = trim(preg_replace('/ {2,}/', ' ', $string));

    return $string;

}
      
/**
 * Finds all of the keywords (words that appear most) on param $str
 * and return them in order of most occurrences to less occurrences.
 * @param string $str The string to search for the keywords.
 * @param int $minWordLen[optional] The minimun length (number of chars) of a word to be considered a keyword.
 * @param int $minWordOccurrences[optional] The minimun number of times a word has to appear
 * on param $str to be considered a keyword.
 * @param boolean $asArray[optional] Specifies if the function returns a string with the
 * keywords separated by a comma ($asArray = false) or a keywords array ($asArray = true).
 * @return mixed A string with keywords separated with commas if param $asArray is true,
 * an array with the keywords otherwise.
 */
function extractKeywords($str, $minWordLen = 5, $minWordOccurrences = 2, $asArray = false)
{
	function keyword_count_sort($first, $sec)
	{
		return $sec[1] - $first[1];
	}
	$str = preg_replace('/[^\p{L}0-9 ]/', ' ', $str);
	$str = trim(preg_replace('/\s+/', ' ', $str));

	$words = explode(' ', $str);
	$keywords = array();
	while(($c_word = array_shift($words)) !== null)
	{
		if(strlen($c_word) < $minWordLen) continue;

		$c_word = strtolower($c_word);
		if(array_key_exists($c_word, $keywords)) $keywords[$c_word][1]++;
		else $keywords[$c_word] = array($c_word, 1);
	}
	usort($keywords, 'keyword_count_sort');

	$final_keywords = array();
	foreach($keywords as $keyword_det)
	{
		if($keyword_det[1] < $minWordOccurrences) break;
		array_push($final_keywords, $keyword_det[0]);
	}
	return $asArray ? $final_keywords : implode(', ', $final_keywords);
}

 

the hook itself works in admin.php under site/templates/:

  Hide contents

/**
 * Hook for changing seo_* fields if empty on Page Publish
 */
$pages->addHookAfter('saveReady', null, 'changeSeoFields');
function changeSeoFields(HookEvent $event) {
    $page = $event->arguments[0];
    //for this template only
    if($page->template == 'artikel'|| $page->template == 'seite') {
        // page is about to be published
        if($page->isChanged('status') && !$page->is(Page::statusUnpublished)) {
            // check if seo_title fields are exist and if they are empty
            if (!$page->seo_title) {
                //get the default value that would used as fallback
                if ($page->headline) {
                    //Headline field is used for seo_title
                    $default_title = ripTags($page->headline);
                } else {
                    //Headline field empty - page title is used
                    $default_title = ripTags($page->title);
                }
                //set seo_title on publishing
                $page->set ('seo_title', $default_title);
            }
            // check if seo_description fields are exist and if they are empty
            if (!$page->seo_description) {
                //get the default value that would used as fallback
                if ($page->kurztext) {
                    $default_desc = ripTags($page->kurztext);
                } else {
                    //is there a main content block as pagetable field pt_inhalt?
                    if(count($page->pt_inhalt)>0) {
                        //get the first text field in the pagetable and use it for the seo description
                        $first_item = $page->pt_inhalt->get("template=part_text|part_text_image_left|part_text_image_right|part_text_spalten");
                        $first_content = ripTags($first_item->text);
                        $default_desc = wordLimiter($first_content, 160);
                    }
                }
                //set seo_description on publishing
                $page->set ('seo_description', $default_desc);
            }
            // check if seo_keywords fields are exist and if they are empty
            if (!$page->seo_keywords) {
                //get the string that should be used to generate automatical keywords for this page
                //we use all textfields in the pagetable from the main content and collect them
                $keyword_texts = '';
                //is there a main content block as pagetable field pt_inhalt?
                if(count($page->pt_inhalt)>0) {
                    foreach ($page->pt_inhalt as $keyword_text) {
                        if ($keyword_text->title) $keyword_texts .= $keyword_text->title;
                        if ($keyword_text->text) $keyword_texts .= $keyword_text->text;
                        if ($keyword_text->text2) $keyword_texts .= $keyword_text->text2;
                        if ($keyword_text->text3) $keyword_texts .= $keyword_text->text3;
                    }
                } else {
                    $keyword_texts = $page->headline.' '.$page->kurztext.' '.$page->title;
                }
                //rip tags
                $keyword_string = ripTags($keyword_texts);

                $default_keywords = extractKeywords($keyword_string);

                //set seo_title on publishing
                $page->set ('seo_keywords', $default_keywords);
            }
        }
    }
}

 

As always it is not the best PHP code since im no professional....but it works for me....if i somedays get some time i could add something like that with optionfields to the module itself. ;)

Best regards mr-fan

WOW, that seems to be the sophisticated version ... :-)

An optionfiled in the module would be great!!!

Best regards!

 

Share this post


Link to post
Share on other sites

Can I revive the subject ? :)

I want to use this module for a website I inherited, (I didn't use the processwire before)

There is one thing that makes me uncertain.

In:  Choose the templates which should get a SEO tab 
There is a note Be careful with this field. If you remove an entry all of it's "seo_*" fields get deleted (including the data).

Is there any risk there

An do I have to type in the Author and Sitename?

2017-10-25_102907.jpg

Share this post


Link to post
Share on other sites
4 hours ago, Marudor said:

Is there any risk there

This simply means that if you assign a template that can use the SEO fields and then you actually use them on a page and then remove the template from the list, the SEO fields will be deleted from the template and, therefore, the pages assigned to it.

4 hours ago, Marudor said:

An do I have to type in the Author and Sitename?

I believe the module's <head> markup might require it, so yes, I'd fill those out.

Share this post


Link to post
Share on other sites

OK thanks

Just to clarify - The author here - means the author of the module or the author of the website  or it doesn't matter what I type in there.

I don't want to blow up the site...:-X

Share this post


Link to post
Share on other sites
2 hours ago, Marudor said:

OK thanks

Just to clarify - The author here - means the author of the module or the author of the website  or it doesn't matter what I type in there.

I don't want to blow up the site...:-X

:lol: Author of the site. I think you can exclude it as I'd imagine the module won't include the relevant tag if it hasn't been specified. You'd need to "view source" in your browser to check if everything is okay. As far as I'm concerned, only the site title is important in terms of meta data.

Share this post


Link to post
Share on other sites

Ok I have chosen the template to MarkupSEO module.  

I does change the meta description and meta keyword which is very handy.

But it didn't change the meta title tag.

It's still the one withe the suffix added that comes from the homepage title 

Eventhough i have type in the short one Employer branding - pracownik staje się klientem - Poznań, Warszawa

I still have Employer branding - pracownik staje się klientem - Agencja PR Q&A Communications – Poznań, Warszawa

Where is the problem ? Why id doesn't change the title tag????

Share this post


Link to post
Share on other sites
2 hours ago, Marudor said:

Ok I have chosen the template to MarkupSEO module.  

I does change the meta description and meta keyword which is very handy.

But it didn't change the meta title tag.

It's still the one withe the suffix added that comes from the homepage title 

Eventhough i have type in the short one Employer branding - pracownik staje się klientem - Poznań, Warszawa

I still have Employer branding - pracownik staje się klientem - Agencja PR Q&A Communications – Poznań, Warszawa

Where is the problem ? Why id doesn't change the title tag????

Changing the title in the SEO tab only affects the SEO title (<meta property="og:title" content="...SEO title...">). Your page title in the browser is the one you set in the <title> tag of your HTML. If you are referring to Google showing the old one, then you will need to wait a while for it to be re-indexed.

Edit: I apologise, it seems I'm incorrect. MarkupSEO will include a <title> tag for you if you fill out "Title Format" in that case, make sure you don't have your own <title> tag as well.

Share this post


Link to post
Share on other sites

I tough this is the module to change the meta title tag and meta description tag.

It changes the description and keyword all right...but the meta title  stays the same.

I  have the article title -  Employer branding - pracownik staje się klientem

But I want the meta title Employer branding - pracownik staje się klientem - Poznań, Warszawa

At the moment the meta title on every psgr is a mix of 2  - the article title and the suffix from the homepage title Agencja PR Q&A Communications – Poznań, Warszawa

I have even changed it in the code from 

<title><?php if($page->id > 1) { echo $page->title .' - '; } echo $home->title ?></title>
TO
<title><?php echo $page->title; ?></title>

BUT still the same. The mix of title with the suffix Agencja PR Q&A Communications – Poznań, Warszawa

added to all article titles makes the meta tag title too long. It Is more than 70 characters on every page. which is no good.

Share this post


Link to post
Share on other sites
21 hours ago, Marudor said:

<title><?php if($page->id > 1) { echo $page->title .' - '; } echo $home->title ?></title>
TO
<title><?php echo $page->title; ?></title>

BUT still the same.

It sounds like you need to change it somewhere else. Because ProcessWire based sites always depend on the developer to implement the frontend, it can be tricky to find the right piece of code. Have you tried something like  <title>AAAAAA<?php echo $page->title; ?></title> for example? As a last resort I always type in some fake string which can be easily searched. If it is not in the source code of the rendered page then that is not right part of the code to change it. You probably need to dig in more, unfortunately.

Share this post


Link to post
Share on other sites

Hello, I found & fixed an issue wich gives you an illegal string offset error in the latest PHP version. (7.1). 

Around line 429 you declare $return = ''; and then fill it up as an array doing $return[$key] = $value; at line 435.

All you got to do is declare $return = array(); instead of $return = ''; and it should be fixed. Filling up an empty string as an array caused the errors. Can you fix this and push it to github? :)

Kind regards,
Jonathan

 

	private function parseCustom($custom) {
		if(trim($custom) == '') return;

		$return = array();
		$lines = explode(PHP_EOL, $custom);
		foreach($lines as $line) {
			list($key, $value) = explode(':=', $line);
			$key = preg_replace('%[^A-Za-z0-9\-\.\:\_]+%', '', str_replace(' ', '-', trim($key)));	
			$value = trim(wire('sanitizer')->text(html_entity_decode($value)));

			$return[$key] = $value;
		}
		
		return $return;
	}

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi,
I'm having a problem with this module. I't installed with Processwire ver3.
The problem is -> on localhost plugin is working fine, but on live server plugin is not working (strange is that it was working fine, but stopped without any reason ):
when i type title, keywords and description and click SAVE, page is reloaded without errors, but i see old entries, so cannot update existing entries.
I was able to edit Title and description, but next attempts fails. So it saves SEO daya randomly, sometimes im able to edit and save, and sometimes it will just return previous values.

Does anybody has this issue ? Thanks.

Actually im seeing this on edit page in SEO TAB

image.png.2c9ee50f8dfef7641101278db0765e35.png

Share this post


Link to post
Share on other sites

If anyone is interested, I have a new fork of this module available here: https://github.com/adrianbj/MarkupSEO/commits/various-fixes-enhancements

It's very much a work in progress, but it includes several bug fixes and lots of new features. Please read the commit log to learn about what's fixed and what's new.

At the moment you should not upgrade an existing site (new fields won't be created) and probably don't use it on a live site just yet.

It's not well tested at all yet, so use at your own peril :) 

I'd really appreciate any feedback on it.

  • Like 14
  • Thanks 2

Share this post


Link to post
Share on other sites

@adrian

Hi Adrian, thank you for the awesome updates and improvements.

I would suggest to take a look on the Canonical link field and make it ready for multi language websites .

Meaning that he can detect if there are any other languages present and canonicalize them properly according to the languages. 

 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, B3ta said:

I would suggest to take a look on the Canonical link field and make it ready for multi language websites .

Hi @B3ta - I'm afraid I don't really have time to look into this at the moment. I am extending this module for my needs and I rarely have multi-language websites so it's not high on my list. I am happy to accept PRs though so together we can build a better version of this module. Once we are all happy with the stability/functionality of the new version I'll try contacting Nico to see what we can do about getting it into the main repo. Hope you understand where I am coming from.

  • Like 3

Share this post


Link to post
Share on other sites

@Nico Knoll for the images, it requires a URL; I am curious if I change those to file upload field will it affect the module? just want to confirm before I try, thank you

Share this post


Link to post
Share on other sites
30 minutes ago, neosin said:

@Nico Knoll for the images, it requires a URL; I am curious if I change those to file upload field will it affect the module? just want to confirm before I try, thank you

In my fork (linked above), the field is an images field (for the page specific SEO tab, not the default image).

  • Like 1

Share this post


Link to post
Share on other sites
49 minutes ago, adrian said:

In my fork (linked above), the field is an images field (for the page specific SEO tab, not the default image).

thank you, I will check it out now

@adrian I've uninstalled the SEO and installed your version however the SEO image fields still show up as url text fields. Do I need to change the fields to images?

Share this post


Link to post
Share on other sites

Hi,

EDIT: Found it, change it in the module configuration. Can't be overwritten by field definition.

 

i cannot change the length of the seo_title field. I changed the field max length to 100 but it is still 60 at the input field. i tried to remove the counter to check, does not work. Tried to change the title and description of the field, this works. I'm confused.

 

Thx for any help!

seotitle.jpg

Share this post


Link to post
Share on other sites
On 3/25/2018 at 8:48 AM, neosin said:

thank you, I will check it out now

@adrian I've uninstalled the SEO and installed your version however the SEO image fields still show up as url text fields. Do I need to change the fields to images?

Sorry I missed this - not getting emails on @ pings anymore. If you upgrade from an old install of this module, you will need to manually change the field type.

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 BitPoet
      MediaLibrary
      Update: MediaLibrary can now be found in the official module list.
      Out of necessity, I've started to implement a simple media library module.
      The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree.
      The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality.
      I've put the code onto github. This module is compatible with ProcessWire 3.
      Steps to usage:
      Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look.
      Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple.
      There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section).

      Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library.

      Edit 01.05.2016:
      Version 0.0.8:
      - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker).
      - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries.
      - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries.
      Edit 10.10.2018:
      Version 0.1.3:
      - Dropped compatibility for ProcessWire legacy versions by adding namespaces
      - Allow deletion of libraries from the Media overview admin page
      - Added an option to hide media libraries from the page tree (optionally also for superusers)
    • By Robin S
      This module corrects a few things that I find awkward about the "Add New Template" workflow in the PW admin. I opened a wishlist topic a while back because it would good to resolve some of these things in the core, but this module is a stopgap for now.
      Originally I was going to share these as a few standalone hooks, but decided to bundle them together in a configurable module instead.
      Add Template Enhancements
      A module for ProcessWire CMS/CMF. Adds some efficiency enhancements when adding or cloning templates via admin.

      Features
      Derive label from name when new template added: if you like to give each of your templates a label then this feature can save some time. The label can be added automatically when templates are added in admin, in admin/API, or not at all. There are options for underscore/hyphen replacement and capitalisation of the label. Edit template after add: when adding only a single template, the template is automatically opened for editing after it is added. Copy field contexts when cloning: this copies the field contexts (a.k.a. overrides such as column width, label and description) from the source template to the new template when using the "Duplicate/clone this template?" feature on the Advanced tab. Copy field contexts when duplicating fields: this copies the field contexts if you select the "Duplicate fields used by another template" option when adding a new template. Usage
      Install the Add Template Enhancements module.
      Configure the module settings according to what suits you.
       
      https://github.com/Toutouwai/AddTemplateEnhancements
      https://modules.processwire.com/modules/add-template-enhancements/
    • By Mike Rockett
      As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown.
      Repo: Parsedown Extra Plugin
      Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation.
      Some examples:
      ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*.
      I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time.
      Please let me know if you bump into any problems. ☺️
    • By Mike Rockett
      TextformatterTypographer (0.4.0 Beta)
      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.
      Learn more on my blog
      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.
      Please do test it out and let me know what you think.
      Also note that I have indicated support for PW 2.8, but I haven't tested there as yet. This was built on PW 3.0.42/62.
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.50
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy!