Hi,
I am using extra page attribute 1 for the meta description and extra page attribute 2 for the meta keywords
Is there an [if} statement I can use to display the Global Meta Data only if the extra page attributes 1&2 are left empty.
At the moment the meta tags are appreaing twice.
Regards
Pat
Replacing Global Metadata with extra page attributes
Re: Replacing Global Metadata with extra page attributes
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Replacing Global Metadata with extra page attributes
in site admin -> global settings -> general settings -> global metadata, try:
_____
what i did was a little different. i removed those two lines (meta keywords, meta description) from global metadata and inserted them in page default metadata instead, modified as follows:
those two global content blocks contain site-wide defaults. then in page edit mode, i just add page-specific data before the gcb, like this:
i could also just change the gcb called and have several already made-up for various pages or areas of a site.
Code: Select all
<meta name="keywords" content="{capture assign=e2}{page_attr key="extra2"}{/capture}{if $e2 neq ''}{page_attr key="extra2"}{else}default,keywords,here{/if}" />
<meta name="description" content="{capture assign=e1}{page_attr key="extra1"}{/capture}{if $e1 neq ''}{page_attr key="extra1"}{else}default description{/if}" />
what i did was a little different. i removed those two lines (meta keywords, meta description) from global metadata and inserted them in page default metadata instead, modified as follows:
Code: Select all
<meta name="keywords" content="{global_content name='meta-keywords'}" />
<meta name="description" content="{global_content name='meta-description'}" />
Code: Select all
<meta name="keywords" content="this, page, keywords, here, {global_content name='meta-keywords'}" />
<meta name="description" content="this page specific description. {global_content name='meta-description'}" />
Last edited by kermit on Fri Jun 11, 2010 1:27 pm, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Re: Replacing Global Metadata with extra page attributes
Hi
Thanks for the assistance - very helpful
Regards Pat
Thanks for the assistance - very helpful
Regards Pat
Re: Replacing Global Metadata with extra page attributes
Hi pmckeown,
If your question is answered here, would you please be so kind and put [solved] in the title of the first post? You can use the modify button for this.
Have fun, Rolf
If your question is answered here, would you please be so kind and put [solved] in the title of the first post? You can use the modify button for this.
Have fun, Rolf

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Replacing Global Metadata with extra page attributes
i was looking at doing the same thing, using per-page extra attribute for meta tags such as 'description', but the field length (255) is too short for some implementations.
Last edited by kermit on Sun Jul 04, 2010 9:24 pm, edited 1 time in total.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
-
- Forum Members
- Posts: 103
- Joined: Fri Nov 28, 2008 11:26 am
Re: Replacing Global Metadata with extra page attributes
Hi Kermit,
Im not sure if this is seen as 'editing a core file' or not, but we also had the same issue for wanting to extend the extra attribute field length...
So I edited the file /lib/classes/class.content.inc.php on line 2085, 2091, 2097 and changed the maxlength="255" bit to maxlength="600".
Our SEO guy is a very happy man now.
kind regards,
Karl.
Ps - if this is seen by the admins as hacking a core file, please could you let me know. Im not sure what constitutes a 'core file' as I'm new here
Im not sure if this is seen as 'editing a core file' or not, but we also had the same issue for wanting to extend the extra attribute field length...
So I edited the file /lib/classes/class.content.inc.php on line 2085, 2091, 2097 and changed the maxlength="255" bit to maxlength="600".
Our SEO guy is a very happy man now.
kind regards,
Karl.
Ps - if this is seen by the admins as hacking a core file, please could you let me know. Im not sure what constitutes a 'core file' as I'm new here

Re: Replacing Global Metadata with extra page attributes
Yep, this is hacking the core files... Not serious, but... there are alternativesbeherenow_uk wrote: Ps - if this is seen by the admins as hacking a core file, please could you let me know. Im not sure what constitutes a 'core file' as I'm new here![]()
And these changed files are overwritten when doing a upgrade!
A better solution in my reply posted above:
http://forum.cmsmadesimple.org/index.ph ... #msg212993
It uses the {content} tag.
Same flexibility, but you don't need to change core files anymore.
Hope this helps
Rolf

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- Forum Members
- Posts: 103
- Joined: Fri Nov 28, 2008 11:26 am
Re: Replacing Global Metadata with extra page attributes
Ahh... I see,
Thanks Rolf, that is a much better solution.
best,
Karl.
Thanks Rolf, that is a much better solution.
best,
Karl.