META TAG Property image??

5 posts by 3 authors in: Forums > CMS Builder Community
Last Post: January 26, 2021   (RSS)

By thenetgirl - December 28, 2020

Anyway to feed a property image into this meta tag???

Detail page - https://gormanre.exedor.us/RentalDetail.php?Carmel-NW-Corner-of-Torres-5th-Unit-12-516

<!-------------------------------------------------------------------->
<!-- Twitter -->
<meta name="twitter:card" content="<?php echo htmlencode($rentalsRecord['Title']) ?>, CA <?php echo htmlencode($rentalsRecord['zip']) ?>">
<meta name="twitter:site" content="https://gormanre.com/<?php echo htmlencode($rentalsRecord['_link']) ?>">
<meta name="twitter:creator" content="">
<meta name="twitter:title" content="<?php echo htmlencode($rentalsRecord['Title']) ?>, CA <?php echo htmlencode($rentalsRecord['zip']) ?> ">
<meta name="twitter:description" content="<?php echo htmlencode($rentalsRecord['property_description_short']) ?> - <?php echo htmlencode($rentalsRecord['Title']) ?> - Gorman Real Estate: Property Management 831-649-3455">


<meta name="twitter:image" content="https://gormanre.com/image2.jpg">

Patricia

www.thenetgirl.com

By Toledoh - December 28, 2020

For all my "pages" I have the following, but you could do similar as a one-off page

	// Page Variables
	$title       = $pagesRecord['seo_title'];
	$keywords    = $pagesRecord['seo_keywords'];
	$description = $pagesRecord['seo_description'];
	$page        = $pagesRecord['page_template'];
	$breadcrumb  = $pagesRecord['seo_description'];

	foreach ($pagesRecord['open_graph_image'] as $index => $upload){
		$image = $upload['urlPath'];
		$imageW = $upload['width'];
		$imageH = $upload['height'];
	}

Then, I use those variables as I like, in your example, something like;

<!-- Twitter -->
<meta name="twitter:card" content="<?php echo htmlencode($title) ?>, CA <?php echo htmlencode($rentalsRecord['zip']) ?>">
<meta name="twitter:site" content="https://gormanre.com/<?php echo htmlencode($breadcrumb) ?>">
<meta name="twitter:creator" content="">
<meta name="twitter:title" content="<?php echo htmlencode($title) ?>, CA <?php echo htmlencode($rentalsRecord['zip']) ?> ">
<meta name="twitter:description" content="<?php echo htmlencode($description) ?>">
<meta name="twitter:image" content="<?php echo htmlencode(@$image) ?>">

    <meta property="og:image"           content="<?php echo (@$image) ?>" />
    <meta property="og:image:width"     content="<?php echo (@$imageW) ?>" />
    <meta property="og:image:height"    content="<?php echo (@$imageH) ?>" /> 
Cheers,

Tim (toledoh.com.au)

By Jenna - January 26, 2021

Hi Patricia,

Just checking in on this post. Did Tim's code help you or are you still looking for a solution?

Please let me know.

Jenna Cooke - PHP Programmer
interactivetools.com

By thenetgirl - January 26, 2021

Yes ..thanks  ...all I have left to do is fix the links with the plugin I bought.

Patricia

www.thenetgirl.com

By Jenna - January 26, 2021

Hi Patricia,

That's great! Thanks for the prompt reply :) 

Jenna Cooke - PHP Programmer
interactivetools.com