Elxis CMS Forum
Support => General => Topic started by: striker on June 23, 2016, 13:00:10
-
Hi Datahell and Elxis Dev Team,
Can you please direct me where exactly is this function located, $eDoc->showHead(); ?
I know that it generates the meta tags, links, etc. but I just want to add something in that function.
I tried searching it from the com_content files but failed to fine the exact location.
Thanks,
-
I am an amateur and may be wrong but I think this is the file you are looking for : includes/libraries/elxis/document.class.php
-
Yes, it is the document.class.php file. You don't have to modify that function. The function displays what it is required by the running extensions to be displayed. If you remove something then something might broke and you will face errors. If you want to add something to the output you can use in any extension (template, module, component, etc) any of the add* functions of the document library (addStyle, addStyleLink, addScript, addScriptLink, addLibrary, addJQuery, addDocReady, addCustom, addLink). Especially with the addCustom method you can add ANYTHING to the document's head section.
$eDoc->addCustom('<test>Wow, I can add anything in head!</test>');
elxisDocument documentation (https://www.elxis.net/docs/developers/libraries/elxisdocument.html)
-
Hi datahell,
I always read the documentation before posting here in the forum but I'm just quite puzzled why this line won't work if I insert it on my template's head section?
$eDoc->addCustom('<meta property="og:image" content="'.$elxis->secureBase().'/'.$row->image.'"/>');
The $row->image piece isn't rendering the image URL.
GOALs:
1. I want to add og tags manually without the use of any plugin.
2. would only render og tags in articles or posts (not in category or other locations)
-
$row->image is wrong, does not exist. Use the functions before you display the head in template index.php file.