Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bjornbjorn/4039233 to your computer and use it in GitHub Desktop.
Save bjornbjorn/4039233 to your computer and use it in GitHub Desktop.
SEO Lite pulling in additional fields
// from config.local.php (FocusLab's config)
/**
*
* Pull additional info for SEO Lite
*
* channel_id => array(field_id => tag_name)
**/
$env_config['seolite_extra'] = array(
'1' => array( // news
'desc' => array(
'field_id' => 3,
'field_type' => 'text',
),
'image' => array(
'field_id' => 45,
'field_type' => 'file',
)
),
'4' => array( // blog
'desc' => array(
'field_id' => 18,
'field_type' => 'text',
),
'image' => array(
'field_id' => 46,
'field_type' => 'file',
)
),
'5' => array( // portfolio
'desc' => array(
'field_id' => 29,
'field_type' => 'text',
),
'image' => array(
'field_id' => 43,
'field_type' => 'assets', // Assets fieldtype, will pick the first image if multiple can be selected
)
)
);
<title>{title}{site_name}</title>
<meta name='keywords' content='{meta_keywords}' />
<meta name='description' content='{meta_description}' />
<link rel='canonical' href='{canonical_url}' />
<meta property="og:url" content="{canonical_url}"/>
<meta property="og:title" content="{entry_title}"/>
<meta property="og:description" content="{extra:desc}"/>
<meta property="og:image" content="{extra:image}"/>
@1stevengrant
Copy link

@bjornbjorn going over old ground here perhaps but I'm seeing the same thing attempting to pull through the full path to an Assets image where it just pulls out image.jpg as an example.

This makes sense though because field_id_x assigned in the config only has image.jpg as the example. I guess I could update the path within the template and restrict the upload directory but would be cool to be able to pull from where ever I want.

@milliephanillie
Copy link

Can you use this plugin on EE version 2.6.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment