Page 1 of 4
MetaMax Module Observations
Posted: Thu Jan 26, 2012 5:15 pm
by Owens
Using {MetaMax} to control everything before the opening </__body> tag in a template is a great simplifying tool. As I notice issues I will make comments here, and I hope others will to.
Report bugs in the forge:
http://dev.cmsmadesimple.org/bug/list/1077
Re: MetaMax MicroTiny Applying Styles in WYSIWYG Area
Posted: Thu Jan 26, 2012 5:22 pm
by Owens
MicroTiny applying styles
Problem: MicroTiny will not apply styles in the WYSIWYG editor if using MetaMax to inject the {cms_stylesheet} tag.
Solution: Add a line to your template that says:
Code: Select all
{capture}{cms_stylesheet}{/capture}
This will allow MicroTiny access to your style sheet in the WYSIWYG editor in the CMSMS admin.
Re: MetaMax Pages Without Text
Posted: Thu Jan 26, 2012 5:24 pm
by Owens
Pages without text
Problem: Pages without text, for example a page that has a single {Gallery} tag in the content area, may show the following error:
Code: Select all
Warning: Invalid argument supplied for foreach() in ../modules/MetaMax/action.default.php on line 50
Warning: array_diff() [function.array-diff]: Argument #1 is not an array in ../modules/MetaMax/action.default.php on line 75
Warning: array_diff() [function.array-diff]: Argument #1 is not an array in ../modules/MetaMax/action.default.php on line 76
Solution: Add some text to the content area that MetaMax can use to auto generate descriptions and keywords.
Re: MetaMax Module Observations
Posted: Thu Jan 26, 2012 5:25 pm
by calguy1000
You should probably file a bug report.
Re: MetaMax Module Observations
Posted: Thu Jan 26, 2012 5:28 pm
by Owens
calguy1000 wrote:You should probably file a bug report.
I have indeed filed the report to Oliver [the MetaMax project admin] but I also wanted to share the information here, to be as helpful to the community as possible.
Re: MetaMax Module Observations
Posted: Fri Jan 27, 2012 9:42 am
by oliverseddon
Owens wrote:calguy1000 wrote:You should probably file a bug report.
I have indeed filed the report to Oliver [the MetaMax project admin] but I also wanted to share the information here, to be as helpful to the community as possible.
I haven't been able to replicate this warning/error but have wrapped the lines in if statements so they only get applied if there is content. If you could try version 1.6.5 and let me know if it prevents you having to use your workaround it would be greatly appreciated.
I'm glad your finding the module useful and appreciate your assistance bug finding and fixing and ideally there would be a module wiki which I could associate with my module, save having to post in the forum and it getting lost over time.
Could this be an addition to the CMSMS wiki section?
But for the time being I'll use this forum.
My CMSMS tip is to capture all your content blocks at the top of your templates and then call {MetaMax} then just insert your captured variables into your template where you need them.
e.g
Code: Select all
{capture assign='pageContent'}{content}{/capture}
{if !isset($pagetitle)}
{capture assign='pagetitle'}{title}{/capture}
{/if}
{MetaMax}
</__body>
<h1>{$pagetitle}</h1>
{$pageContent}
<__body>
</__html>
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 8:16 am
by Gregor
In addition to the observations above:
1. Although "Generate Doctype tag:" is clicked, none is created.
2. Keywords in combination with CGBlog, any suggestion on how to pick the keywords used in an article?
I installed Metamax on
http://www.uisge-beatha.eu
Gregor
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 9:47 am
by oliverseddon
Hi, I'm currently working on how to get the keywords and descriptions out of non-content blocks so will hopefully have an updated version on it's way soon to solve your first issue.
The second one is quite strange. I have just looked at your page source and what is being output doesn't look like MetaMax is creating it.
Can you post your template code, or at least the <head> stuff?
Thanks
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 12:23 pm
by Gregor
Thanks for you quick reply. Already looking forward to the next version
The head currently looks like:
Code: Select all
{capture assign='get_content'}{content}{/capture}
{if !isset($pagetitle)}
{capture assign='pagetitle'}{title}{/capture}
{/if}
{metadata}
{strip}
{process_pagedata}
{*<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl" xmlns:addthis="">*}
{/strip}
<head>
{cms_stylesheet}
{* This is how all the stylesheets attached to this template are linked to * }
{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if *}
{if $canonical != ''}
{* detail pagina mobiel http://m.xxx.nl/log/99/munge_string_to_url_title/ *}
{* canonical = http://www.xxx.nl/blog/99/munge_string_to_url_title/ *}
<link rel="canonical" href="{$canonical}" />
{elseif $page_name == 'lbjaar'}
{* index pagina mobiel www.m.xxx.nl/blog/ *}
<link rel="canonical" href="http://www.uisge-beatha.eu/logboek/" />
{/if}
{* 28nov11 use strip to get rid of whitespace -- http://www.i-do-this.com/blog/48/Put-your-CMSMS-Metatags-on-autopilot *}
{*strip} { * use strip to get rid of whitespace * }
{content assign="get_content"}
{if !isset($get_title)}
{title assign='get_title'}
{/if}
{/strip*}
<title>
{$get_title} - {sitename}
</title>
{* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *}
{tracewatch}
{*SEOTools2*}
{*autometa*}
{*metadata*}
{* Don't remove this! Metadata is entered in Site Admin/Global settings. *}
{cms_selflink dir="start" rellink=1}
{cms_selflink dir="prev" rellink=1}
{cms_selflink dir="next" rellink=1}
{*Relational links for interconnections between pages, good for accessibility and Search Engine Optmization*}
{global_content name='UB_head_js'}
{capture assign="metadescription"}{content block="metadescription" wysiwyg='false' default=''
label='Meta Description' rows='4'
description='Logboek van zeilboot Uisge Beatha, beschrijving van tochten, ervaringen en klussen die aan mijn Hanse 311 door mij worden of zijn gedaan.'}{/capture}
{CGFeedMaker action='autodiscovery' feed='logboek'}
{analitics urchin="UA-3361592-1"}
</head>
This string
I added to "Extra HTML tag content:"
Thanks, Gregor
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 1:15 pm
by oliverseddon
I can't see any calls to {MetaMax} in that template, just the default {metadata} call.
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 1:23 pm
by Gregor
OMG
Changed it. Thanks.
Just saw a stylesheet is not loaded. have to look into it (Menu -> Fotoos)
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 1:43 pm
by Gregor
Figured out the stylesheet issue. I had a stylesheet attached to an Album-template, so it would only load if a visitor enters one of the Albums, however for some unknown reason the stylesheet is not loaded in combination with {MetaMax}. If I attach the stylesheet to the template, than the Albums are shown correct. Like I said, don't why it acts that way.
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 2:05 pm
by Gregor
Getting there

If I add
Code: Select all
{capture}{content block='Paginabeschrijving' oneline='true' wysiwyg='false'}{/capture}
{capture}{content block='Metadata' wysiwyg='false'}{/capture}
between <__body> and </__html> than in the page source I see "paginabeschrijving" being added <meta name="description" content="Foto's van zeiltochten in binnenland en buitenland" /> however "Metadata" is not added to <meta name="keywords" content="watersport, zeilen" />.
Link to 'test page'
http://www.uisge-beatha.eu/fotoalbum/zeiltochten.html
Any idea?
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 3:49 pm
by oliverseddon
The Metadata content block is there to enable page specific metadata. For example if one page requires a Javascript call and you don't need it to appear on every page you can specify it in the Metadata content block set up like you have.
The keywords are automatically generated depending on the page content, currently these are only take from text appearing in the main page content block. You can tweak the keyword parameters until you see the right type, quantity, length of keywords your after.
To be honest though the keywords meta tag isn't really used and I tend to use it as more of an analysis tool to check my site content has enough relevant keywords in the copy as this is far more likely to help your SEO than forcing non relevant terms into your pages. So if your not seeing the keywords you want then I'd start with looking at your site content and make sure those terms are appearing there first.
Re: MetaMax Module Observations
Posted: Sun Feb 26, 2012 3:58 pm
by oliverseddon
I have also noticed your source is a bit messed up, you have two <title> calls, one generated by MetaMax and there must be another in your template or something similar. Your metadata is currently sitting outside of you <head> tags too, again these calls must be being set outside of MetaMax.
I would suggest adding your JS calls to the MetaMax additional content block under the HTML tag settings tab and selecting the generate opening and closing head tags checkboxes.
You can then add your Analytics tracking code via MetaMax too by adding your Analytics ID, UA-3361592-1 to the web property ID input area under the Analytics Account settings tab and choosing the type of analytics your needing from the drop down, I tend to choose multiple top level domains.