irantk
12-12-2018, 07:47 AM
Hi
my plugin load in "showthread_complete" and it's code is:
global $pagenumber, $perpage, $totalposts, $pagetitle, $threadinfo;
$totalpages = ceil($totalposts / $perpage);
$templater = vB_Template::create('opengraph_inshowthread');
$templater->register('pagenumber', $pagenumber);
$templater->register('totalposts', $totalposts);
$templater->register('perpage', $perpage);
$templater->register('totalpages', $totalpages);
$templater->register('pagetitle', $pagetitle);
$templater->register('pagedescription', $threadinfo['description']);
$template_hook['headinclude_bottom_css'] .= $templater->render();
and "opengraph_inshowthread" template code is:
<meta property="og:title" content="{vb:raw pagetitle} - page {vb:raw pagenumber} of {vb:raw totalpages} pages" />
But nothing adds to head. how to add my template to head?
I need to point out that I can not load the plugin in the "parse_template". Because the page number and other variable is not recognized in "parse_template".
and How can I use "{vb:rawphrase thread.title}" in my template?
my plugin load in "showthread_complete" and it's code is:
global $pagenumber, $perpage, $totalposts, $pagetitle, $threadinfo;
$totalpages = ceil($totalposts / $perpage);
$templater = vB_Template::create('opengraph_inshowthread');
$templater->register('pagenumber', $pagenumber);
$templater->register('totalposts', $totalposts);
$templater->register('perpage', $perpage);
$templater->register('totalpages', $totalpages);
$templater->register('pagetitle', $pagetitle);
$templater->register('pagedescription', $threadinfo['description']);
$template_hook['headinclude_bottom_css'] .= $templater->render();
and "opengraph_inshowthread" template code is:
<meta property="og:title" content="{vb:raw pagetitle} - page {vb:raw pagenumber} of {vb:raw totalpages} pages" />
But nothing adds to head. how to add my template to head?
I need to point out that I can not load the plugin in the "parse_template". Because the page number and other variable is not recognized in "parse_template".
and How can I use "{vb:rawphrase thread.title}" in my template?