Forums / Setup & design / MetaDataArray description won't take hold

MetaDataArray description won't take hold

Author Message

James Packham

Friday 23 April 2004 9:03:31 am

Hi,

I'm trying to setup my meta tags to be automatically generated from the site.ini files and so far all of them work except for description. For some reason I get:

<meta name="description" content="Home " />

When in the site.ini.append I've put:

MetaDataArray[description]=This site is the one-stop......

I've no idea where the word Home came from, it doesn't appear anywhere is the file. At first I thought it might be an override issue, so I checked in settings/override/site.ini.append.php, but there's nothing in there to do with the MetaDataArray.

Has anyone got any thoughts?

Regards,

James

Rinze Cats

Wednesday 30 June 2004 3:15:57 am

did you ever solve this problem? I am experiencing the exact same problem
rinze

Paul Forsyth

Wednesday 30 June 2004 3:49:35 am

Its coded in index.php:

    $metaDescription = "";
    if ( isset( $moduleResult['path'] ) and
         is_array( $moduleResult['path'] ) )
    {
        foreach ( $moduleResult['path'] as $pathPart )
        {
            if ( isset( $pathPart['text'] ) )
                $metaDescription .= $pathPart['text'] . " ";
        }
    }
    $meta['description'] = $metaDescription;

Basically description holds path information. If you want your description to come through you will need to comment out this code.

A better way would be to test for the presence of a description element in the meta array and use it instead if it exists.

paul

--
http://www.visionwt.com

Rinze Cats

Wednesday 30 June 2004 7:36:50 am

I think this is a design error in ezpublish? Why make every metatag customizable, except the description? When looking in the default site.ini, it even assigns a value to metadaraarray[description] without ever using it by design. I find this strange.

Do you know which php file contains the code that reads the meta information from the site.ini file? I think the function used should be altered to use the description value when present.

A note on the side: many thanx for all your contributions in the forum paul, they have proved very usefull to me!

Paul Forsyth

Wednesday 30 June 2004 8:23:12 am

I should have entered the whole code fragment for meta tags. Here it is from index.php:

    $meta = $ini->variable( 'SiteSettings', 'MetaDataArray' );

    $metaDescription = "";
    if ( isset( $moduleResult['path'] ) and
         is_array( $moduleResult['path'] ) )
    {
        foreach ( $moduleResult['path'] as $pathPart )
        {
            if ( isset( $pathPart['text'] ) )
                $metaDescription .= $pathPart['text'] . " ";
        }
    }
    $meta['description'] = $metaDescription;

As you can see the $meta variable is populated from the site.ini MetaDataArray array. The easiest way to fix this is to change the line:

    $meta['description'] = $metaDescription;

to:

    $meta['path_description'] = $metaDescription;

This should stop the default description from being overriden. I notice that description works on the ez web site and some our older visionwt sites. But new sites are affected. Digging through the index.php revisions the change occured some 17 months ago:

http://pubsvn.ez.no/websvn/diff.php?repname=nextgen&path=/trunk/index.php&rev=1461&sc=1

which should have impacted us some time ago...

Hope this helps!

paul

--
http://www.visionwt.com

eZ debug

Timing: Jan 18 2025 19:11:43
Script start
Timing: Jan 18 2025 19:11:43
Module start 'content'
Timing: Jan 18 2025 19:11:43
Module end 'content'
Timing: Jan 18 2025 19:11:43
Script end

Main resources:

Total runtime0.1694 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.9766180.8125
Module start 'content' 0.00690.0066 769.789198.0547
Module end 'content' 0.01350.1558 867.8438526.6250
Script end 0.1693  1,394.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.3308200.0002
Check MTime0.00150.8810200.0001
Mysql Total
Database connection0.00090.508910.0009
Mysqli_queries0.119770.66471410.0008
Looping result0.00120.71251390.0000
Template Total0.155491.710.1554
Template load0.00110.654010.0011
Template processing0.154391.084910.1543
Override
Cache load0.00080.491710.0008
Sytem overhead
Fetch class attribute can translate value0.00080.494110.0008
XML
Image XML parsing0.00020.145810.0002
General
dbfile0.00502.9419200.0002
String conversion0.00000.004130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs