Jump to content
Nico Knoll

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

Recommended Posts

I fixed this bug and changed how customs are rendered. So now they will overwrite existing meta tags if they have the same key.

That means: I won't add a special "robots" field to pages, but if you define "robots := index,follow" in the custom area, that will overwrite config settings. Guess that should do the job, too.

Share this post


Link to post
Share on other sites

And some more minor changes: I switched to PHP_EOL instead of \n and \n\r, which should solve the double line break issue. And I added a option, to add a whitespace at the beginning if automatically inserted. (will publish it in 10min)

  • Like 1

Share this post


Link to post
Share on other sites
That means: I won't add a special "robots" field to pages, but if you define "robots := index,follow" in the custom area, that will overwrite config settings. Guess that should do the job, too.

Good idea!

And some more minor changes: I switched to PHP_EOL instead of \n and \n\r, which should solve the double line break issue. And I added a option, to add a whitespace at the beginning if automatically inserted. (will publish it in 10min) 

Even more good ideas :-)

  • Like 1

Share this post


Link to post
Share on other sites

Even more questions ;-)

After a short look into the source i found :

  • seo_tab
  • seo_tab_END
  • seo_title
  • seo_keywords
  • seo_description
  • seo_custom
  • seo_image
  • seo_canonical

As accessible fields in the Template when using manual mode ?

How do i access  things like the generated Open Graph or Twitter Cards or maybe the Robots setting? Are they added to Custom ?

Share this post


Link to post
Share on other sites

Everything rendered should be available through $page->seo->...

(More complicated keys like "og:site_name" are available through $page->seo->{"og:site_name"})

  • Thanks 1

Share this post


Link to post
Share on other sites

@ Nico

I believe the Google Preview shows the wrong path. Underneath the title the path of the admin page shows in stead of front end url.

Share this post


Link to post
Share on other sites

@Nico: Thx! 

Can you also take look at this part:

When you fill in the Twitter Username, it prints in the metatags correctly. But when you visit another page and go back to the modules settings page, the field of Twitter Username is empty!  

Share this post


Link to post
Share on other sites

Getting this nice little error (see screenshot)

The image_main of this template actually is just a single image so i guess $main_image does not return the array or object your functions expects. Plus the "Formated value" of this field is set to  "single item(null if empty)" in field settings.  

But i am not sure if this is the reason ?

Edit: I used the image_main field as fallback for seo_url in module settings , even if this is not wanted for as one is a plaintext(url) field and the other is an image field , i think a fatal error should not happen.

post-2434-0-86433000-1419267352_thumb.pn

Share this post


Link to post
Share on other sites

Don't worry - I'll take a look later on today :)

Don't worry - I'll take a look later on today :)

Share this post


Link to post
Share on other sites

Hi Nico, I tried your module today, installed version 030 first from a previous download, then upgraded to the current version 060. 

After that I tried to uninstall the module to try that out and got an error:

Catchable fatal error: Argument 1 passed to Fields::___delete() must implement interface Saveable, null given in /mypath/wire/core/Fields.php on line 265

Share this post


Link to post
Share on other sites

Hey - the problem is that there are no fields to delete if only updated and not installed. 0.3.0 is not compatible to 0.6.0 and I think the best thing todo is to delete 0.3.0 first and then install 0.6.0. (Still beta until 1.0.0).

In your case you just have to comment the uninstall method out or delete it completely from the module's file.

@everyone with the other bug: I manged to get it working today. Need to do some more test and will upload it tomorrow.

Share this post


Link to post
Share on other sites

I deleted the module directly from the database and installed it again.

Yes: install/uninstall is fine when doing a fresh, clean install. The update was the problem.

Share this post


Link to post
Share on other sites

Okay :)

@NorbertH: I updated the module. Could you try it and tell me if the bug is fixed?

Share this post


Link to post
Share on other sites

Hi Nico,

Just found out about this module! I'm going to give a spin tomorrow :)

I guess I was away a little bit too long from the forum....

  • Like 1

Share this post


Link to post
Share on other sites

Nico, I'm using your module in many sites, it's great...but just one think, what about pagination? I would like to add something like {pageNum} or similar into title format like

{title} - {sitename} - {pageNum}

Other idea: what about having a title format based on template? I have a photo website and and I would like to create custom title for each photo, I cannot edit each photo one by one, right now I detect the template in my head.inc and for those pages I add a custom title but could be nice having something inside your module
example:
I have "picture" template and I would like the title as:

{phototitle} - This is a Photo by {author} for category {category.title}

where 
phototitle & author & (category is a pagefield so I can access other data like title)
are fields of picture template

Share this post


Link to post
Share on other sites

PageNum makes sense to me but how do I find out the actual page number? Only by getting "page" from the url?

For your picture profile I would recommend to disable "auto title" and  just to do it like this in your picture template:

<?php

$custom_title = $page->title.' - This is a Photo by '.$page->user->title.' for category '.$page->category->title;

include 'head.inc';

.
.
.

And in your head something like:

<title><?php ((isset($custom_title)) ? $custom_title : (($page->seo->title != '') ? $page->seo->title : $page->title. ' - '.'My cool Webseite')); ?></title>
  • Like 1

Share this post


Link to post
Share on other sites

Nico, when I set a title in the SEO tab, the preview doesn't update according to the default title setting... So, the preview won't match up.

Also, is it no longer possible to set different titles? The site title format is now applying to both the page title and the SEO title. Is this by design?

Share this post


Link to post
Share on other sites

Well, there aren't "default title settings". If you leave the seo title field empty it uses the "{titile} - {sitename}" thing. If you put a title into the seo field it shouldn't use "{titile} - {sitename}". I'll take a look at the code. Could you add this as an issue on github? 

Share this post


Link to post
Share on other sites

In the previous version (0.3), the title tag and the og:title tag would differ as, before, the title tag was not automatically inserted.

Now, the title field (and not the seo title field) becomes useless when it comes to the title tag, as the seo title field will be used for it if filled out.

With the previous version, it did what I expected it to do: insert og:title for me, so that the Google result title would be different. Of course, I entered in my title tag manually, which worked.

So, I think that there should be an option to not include the title tag, if someone wants to insert it manually.

I'll open an issue regarding making the option available.

Share this post


Link to post
Share on other sites

Hi Nico,

it's about time for me trying your module. Fist of all: Thank you for sharing!

I have a question about the title (or maybe a wish):

The title can be pre-filled automatically. I like that. But it is limiting for me.

Right now I have a separate field for the window title, called title_window.

The reason:

This gives me the freedom to name the page differently in the admin (for the page list and selections) and the real title output.

The title is filled in by the editor and the title_window is left to set by the seo guy.

In case the title_window (SEO) is not set, there is a fallback to the title, when I output the site.

(I think that is the way Wordpress handles that too, in combination with the SEO module, if I recall this correctly.)

(EDIT: Why an extra field and not the module: I do not like the tab clicking to the SEO area in the normal workflow of an editor.

I want the editor to have the title and the SEO title close together. - But this is a matter of taste)

Is there a way to mimic that in the module?

Select a custom field with a fallback to title?

(Of course there are workarounds for me - maybe this idea finds friends in the community But maybe this makes things too complicated. :-) )

And some small thoughts:

canonical

I would like a comment to the canonical tag field what default you set in case the field is empty.

(it is probably the page url without segments and variables?)

segments and variable

A question is how to handle segments and variables (page numbers) best?

I use segments and page numbers for filtering content.

To avoid double content I set my templates manually at the moment to set a noindex tag in case a segment or page number is found.

I wonder if this is good practice/needed when there is a canonical tag.

link rel="alternate" hreflang

On my multi-language sites I have something like this:

<link rel="alternate" hreflang="en" href="http://mysite.com/en/press/" />
<link rel="alternate" hreflang="es" href="http://mysite.com/es/prensa/" />
<link rel="alternate" hreflang="en-us" href="http://mysite.com/us/press/" />

This links same content in different languages together for Google.

Depending on how languages are set up on the site, the module could easily write such code automatically.

(Right now I have some hand coded stuff which does exactly that...)

EDITED

  • Like 1

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 MoritzLost
      This module allows you to integrate hCaptcha bot / spam protection into ProcessWire forms. hCaptcha is a great alternative to Google ReCaptcha, especially if you are in the EU and need to comply with privacy regulations.

      The development of this module is sponsored by schwarzdesign.
      The module is built as an Inputfield, allowing you to integrate it into any ProcessWire form you want. It's primarily intended for frontend forms and can be added to Form Builder forms for automatic spam protection. There's a step-by-step guide for adding the hCaptcha widget to Form Builder forms in the README, as well as instructions for API usage.
      Features
      Inputfield that displays an hCaptcha widget in ProcessWire forms. The inputfield verifies the hCaptcha response upon submission, and adds a field error if it is invalid. All hCaptcha configuration options for the widget (theme, display size etc) can be changed through the inputfield configuration, as well as programmatically. hCaptcha script options can be changed through a hook. Error messages can be translated through ProcessWire's site translations. hCaptcha secret keys and site-keys can be set for each individual inputfield or globally in your config.php. Error codes and failures are logged to help you find configuration errors. Please check the README for setup instructions.
      Links
      Github Repository and documentation InputfieldHCaptcha in the module directory (pending approval) Screenshots (configuration)

      Screenshots (hCaptcha widget)

       
       

       
    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: PrivacyWire Git Repo
      Download as .zip
      I would love to hear your feedback 🙂
      CHANGELOG
      0.1.1 Debugging: fixed error during uninstall 0.1.0 Added new detection of async scripts for W3C Validation 0.0.6 CSS-Debugging for hiding unused buttons, added ProCache support for the JavaScript tag 0.0.5 Multi-language support included completely (also in TextFormatter). Added possibility to async load other assets (e.g. <img type="optin" data-category="marketing" data-src="https://via.placeholder.com/300x300">) 0.0.4 Added possibility to add an imprint link to the banner 0.0.3 Multi-language support for module config (still in development) 0.0.2 First release 0.0.1 Early development
    • By bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
×
×
  • Create New...