Jump to content
Nico Knoll

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

Recommended Posts

What kongondo wrote is right but unfortunately this doesn't work in MarkupSEO (at least I couldn't get it to work).

Fortunately it's very easy to override values because all seo fields are real fields:

$page->seo_title = $page->seo_title . ' - My custom suffix here!';

And you can do this with all the MarkupSEO fields. To set a new value for the og:image, modify the "seo_image" field (untested).

  • Like 2

Share this post


Link to post
Share on other sites

Since ->render is just another string, overriding an individual field value like ->seo_image doesn't change it. The only options appear to be (a) generating the markup myself using all of the individual field values (thus not using ->render at all), or (b) operating directly on the value of ->render, e.g. via regex.

Although (a) is the more flexible, future-proof option, at the moment I am using (b). If a future version of the module changes the markup, or I need more flexibility, I'll revisit it.

Share this post


Link to post
Share on other sites

If you set the Robots field to index and follow, can you over-ride this on an individual page?

There's a per-page Custom field in the SEO tab which reads

If you want to add other meta tags, you can do it here.

I was expecting to paste

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">

into this area but it outputs oddly as:

<meta name="META-NAMEROBOTS-CONTENTNOINDEX-NOFOLLOW" content="">

Furthermore, the original INDEX and FOLLOW still appear further up the list of META tags

Share this post


Link to post
Share on other sites

Hi there, I've discovered a bug yesterday that only seem to affect the Module in certain conditions. 

MarkupSEO seems to work ok on our site but when crawlers or SEO Profilers tries to profile our site, the module seems to encounter an error in a class construction stage and stops.

For a long time, I actually thought this was due to the Blog Module I had installed (Long story short i had lots of installation issues) and there's a particular error message that started occurring around that time in our system that I always attributed to the Blog Module Installation. 
Everything was working as far as I know, so I dismissed the errors as not something critical.

We kept getting messages from profilers/crawlers that stated they couldn't read our Meta Tags (which is produced by MarkupSEO) but when we would inspect our HTML on our servers and also on test servers, we could see all its presence. So it baffled us for a quite a while.

Then I stumbled on a SEO Profiling tool that actually showed the HTML it was using to profile, and I couldn't see any tags MarkupSEO produced.

That's when I realised there must have been an error with the Module instantiating and doing its task, when it was crawlers or profilers using the site.

So when I had a look at our error logs I realised that this reoccurring mysterious error was in fact originating from MarkupSEO.

My guess for the cause of the error is a change in how they implemented class construction in one of the different PHP versions. I'm still running on PHP 5.5 on our server and my guess is that crawlers and SEO Profilers are on a newer PHP version and there's some problems instantiating on a newer version.

This was the profiling tool I used to discover the error:

http://www.seocentro.com/tools/search-engines/metatag-analyzer.html

This is an example error log 

55 minutes ago
2015-12-21 10:14:29 guest / SQLSTATE[HY000]: General error: could not call class constructor [pageClass=Page, template=]

Happy to provide any additional info that you might need.

The site I'm working on is called sprachspielspass.de  just in case if it works on other test sites you've chosen   

  • Like 1

Share this post


Link to post
Share on other sites

Crawlers do not have any php versions only servers do (otherwise this would be a gaping security hole). So that's certainly not the problem. But you're missing head and body tags, which while technically optional in html5 are still needed by lots of crawlers.

  • Like 1

Share this post


Link to post
Share on other sites

Crawlers do not have any php versions only servers do (otherwise this would be a gaping security hole). So that's certainly not the problem. But you're missing head and body tags, which while technically optional in html5 are still needed by lots of crawlers.

You're right about the head & body tags gone AWOL.

Looks like Pro-Cache is removing them(!!) as they returned when I turned it off

I will get on the appropriate forum. 

Danke LostKobrakai

Share this post


Link to post
Share on other sites

If you set the Robots field to index and follow, can you over-ride this on an individual page?

Hi guys. Sorry for the double post just wanted to ping this again.

Basically I have Index and Follow set in the Robots part of this module.

How (via the Module)  can I set a NOFOLLOW or NOINDEX on a per-page basis to over-ride the default?

It seems like it's not possible or has been overlooked?

post-1166-0-40312200-1450713851_thumb.pn

Share this post


Link to post
Share on other sites

@peter: Good question. Haven't worked on the module for a long time now as I had a lot to do recently. Have you added this to GitHub already? I know there a couple of other open issues on Github but when I find the time to work on that module I will start with the github issues :)

Share this post


Link to post
Share on other sites

@peter:  Have you added this to GitHub already?   :)

Hey @nico

I hadn't (yet) as I thought it was me overlooking something. Will do soon. Thanks

Share this post


Link to post
Share on other sites

I have to change some of the MarkupSEO code to adapt the right og: images from my pages...

The problem is that i use PageTableExtended to build my blocks with text, images and so on.

So i have a single "image" field and a "images" field for small galleries....so far the content building works with rendering the single pagetable parts...but

How get i the images from the single parts (like a block with text right and single image left or first image of a block of a gallery)?

I've manged to change the code from the module that i've a better fallback solution in the modul. It was no ideal solution that in the original module if you set a defaul image in the settings and actived the smartimage option....always the default image path was used...not that great deal.

i changed this lines and switched the if statements - and it works as expected:

case 'image':
	//first check for smartimages
	if($configData['imageSmart'] && count($page->get(implode('|', $configData['imageSmart']))) > 0) {
			$imageFields = $page->get(implode('|', $configData['imageSmart']));
			try {
				$pageData['image'] = $page->get(implode('|', $configData['imageSmart']))->first()->httpUrl;
			} catch (Exception $e) {
				$pageData['image'] = $page->get(implode('|', $configData['imageSmart']))->httpUrl;
			}
	//no smartimage there use default image from module settings
	} elseif($configData['image']) {
			$pageData['image'] = $configData['image'];
	}

How could i get the first image from all pagetable items of the $page?

$page->get(implode('|', $configData['imageSmart']))->first()->httpUrl;

I've no good idea right now... :undecided:

regards mr-fan

Share this post


Link to post
Share on other sites

I'm stucked again... ;)

before i waste my time on diving into the module code to get this complex thing done (get "smart" images as seo_image from pagetable templates)...i tried to setup a saveReady Hook in admin.php to test if it works...and now i have very strange output.

her is my simply (and/or stupid function):

/**
 * Hook for changing seo_* fields if empty on Page Save
 */
$pages->addHookAfter('saveReady', null, 'changeSeoFields');
function changeSeoFields(HookEvent $event) {
  $page = $event->arguments[0];
  //for this template only
  if($page->template == 'basic_page') {
  // check if seo_image exists and if it is empty
      if (!$page->seo_image) {
        //is there a main content block as pagetable field pt_inhalt?
        if(count($page->pt_contents)>0) {
          $first_i_item = $page->pt_contents->get("template=part_image|part_text_image_left|part_text_image_right|part_gallery");
            if ($first_i_item) {
              //two variation of templates with single image
              if ($first_i_item->template->name == 'part_image' || $first_i_item->template->name == 'part_text_image_left' || $first_i_item->template->name == 'part_text_image_right') {
              
                $first_i_url = $first_i_item->image->httpUrl;
              
              //or a little gallery with images  
              } elseif ($first_i_item->template->name == 'part_gallery') {
                
                $first_i_url = $first_i_item->images->first()->httpUrl;
                
              } else {
                
              $first_i_url = "";
            }
          }
        //set seo_image on publishing
        $page->set ('seo_image', $first_i_url);
        
        //messages to debug
        
        $page->message('Pfad '.$first_i_item->image->httpUrl);
        //gives me nothing image->url too

        $page->message('SeiteID '.$first_i_item);
        //gives me the id of the PT Page for example 1178        
        
        $page->message('SeiteID '.$first_i_item->name);
        //gives me the name of the PT Page for example 1178 but ->bild->name is not there, too...
      }
    }
  }
}

I get a "page with this function and this page == the pagetable item with a image ....but i can't get the image itself and the url???

I don't wanna parse the whole DOM for the first image url...since all the PW data is there but something i miss here.

regards mr-fan

Share this post


Link to post
Share on other sites

Hi Nico

If you use ProCache with your module and have your module handling Google Analytics insertion, the GA code is stripped out by ProCache when you tell ProCache to minify the HTML output.

Any idea why this happens? I tweaked ProCache not to minify inline JS and it still seems to strip it out, so it's almost like your module is altering the markup and then ProCache is also altering the original markup and overriding your altered markup :)

I think it's going to be something to do with the order they run in maybe, but not sure. Thought you'd be interested anyway!

  • Like 1

Share this post


Link to post
Share on other sites

@pete: I'll have holidays at university in around a month and gonna tackle all open issues with the module from GitHub. So thanks for finding it - could you add it at GitHub as well so I won't forget it? :)

  • Like 1

Share this post


Link to post
Share on other sites

Hello there,

Does anyone know whether this module can be safely loaded with the latest PW V3?

Ta! :)

Share this post


Link to post
Share on other sites

Seems to be working fine for me on 3.0.10 - but I haven't exercised it to the full yet.

  • Like 2

Share this post


Link to post
Share on other sites

I have installed your module on under PW 3.0.12. Is there a way that this module grasps the summary of a page to include in the description? I'm actually using this code on the head. And, of course, OG:description should read it too.

<meta name="description" content="<?php echo $page->summary; ?>" />

Share this post


Link to post
Share on other sites

I have a hook after saveReady that change some SEO fields on publishing the page.... my editors should publish a page when the work is nearly finished so content and other things are on the line and i can with some functions create my semiautomatic SEO fields content.

Most editors don't care about SEO fields and SEO tab i have to create the content...in the example i use the summary (or in german "kurztext") that exists in article pages, if that summary is not there (like on normal pages) i cut some text from the first textfields of my pagetable contentblock templates...so you can skip this part if you just set the summary to seo_description!

So Users could overwright the seo fields but could not leave them empty... ;)

Extracted example for seo title and description ignore some own functions for formatting proposal...:

/**
 * 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);
			}
		}
	}
}

Best Regards mr-fan

  • Like 2

Share this post


Link to post
Share on other sites

Hi Nico

Did you ever get a chance to consider this feature?

Ability to set NOFOLLOW and NOINDEX on a page level and over-ride any "master" settings applied in the Module settings page?

I know you're busy etc. Just a friendly reminder :)

Share this post


Link to post
Share on other sites

Nope it's already in the master so you should be able to use it. If it doesn't appear in "upgrades" I'll may have to adjust the version number :)

Share this post


Link to post
Share on other sites

Nope it's already in the master so you should be able to use it. If it doesn't appear in "upgrades" I'll may have to adjust the version number :)

Ok, thanks. It's 0.8.4 which is showing at the moment.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      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! :)
    • By BitPoet
      As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now:
      InputfieldSlideToggle
      Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary.
      Status
      Still very alpha, use with caution!
      Features / Field Settings
      Size
      You can render the toggles in four different sizes: small, medium, large and extra large.
      Off Color
      Currently, "unchecked" toggles can be displayed either in grey (default) or red.
      On Color
      "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red.
      Screenshots

      Some examples with checkbox label


      View all Size and Color Combinations
      Small toggles Medium toggles Big toggles Extra big toggles  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...