1

I have a problem on the generation of an article creation date . The code is inside the script google < script type = " application / ld + json " > and my code is this :

<?php echo JHTML::_('date', $this->item->created , JText::_('20y-m-dTh:m:s+01:00')); ?>

The problem is that when I write this code , php writes to me to the current date and not the date of creation . Why?

Thanks for any help

  • In what file is this code? Is $this already a defined variable in that file? – Michael Yaeger Sep 1 '16 at 13:13
  • This code there is in a file of plugin wbAMP. Name of this file is head.php of folder plugin. $this i think that is defined in a k2 page, in item.php but is not defined in current page. I tried more types of code but ever without results. The result is ever the date of today and not the pubblished date of my article. :( – Gabriel91 Sep 1 '16 at 13:27
  • Are you using the community version or the full version of wbAMP which comes from a subscription? – Michael Yaeger Sep 1 '16 at 13:47
  • At the moment only community version – Gabriel91 Sep 1 '16 at 13:52
1

Modifying page layout

The full AMP page layout as well as all sections are implemented by wbAMP as JLayout. This means you can override any part of the output through your template overrides. Please refer to Joomla! documentation for details.

wbAMP JLayouts are located in the /plugins/system/wbamp/layouts folder.

If you are trying to create your own custom AMP layouts, I would copy the aforementioned folder to your own template folder as an output override and modify the code that is already there.

Date Published and Date Modified

wbAMP may be able to figure out the publication and modification date of your content. It will do so for Joomla articles and K2 items. You can however insert tags to set those dates, whether to override com_content or K2 values, or provide dates for other types of content. The syntax is as follow:

{wbamp-meta name="date_published" content="2016-03-11"}
{wbamp-meta name="date_modified" content="2016-03-11"}

You can have alternative syntax for the date and time. We will use the timezone currently set in your Joomla configuration to compute the time, but you can also set a time offset ((see examples below)).

{wbamp-meta name="date_published" content="2016-03-11 01:02:03"}
{wbamp-meta name="date_modified" content="2016-03-11 01:02:03+04:00"}

You may try using the default layouts and forcing the dates as shown in the code above.


K2 Support: According to both the Weeblr and Joomla! SEO websites, wbAMP support for K2 is added in the "full" version. You will have an additional plugin called "K2 wbAMP support".

Purchasing the subscription version of wbAMP will, also, give you direct access to support from Weeblr. They will be much more capable of handling any future questions you have regarding their plugin.

  • Thank you man for response. But this problem it is also for regular items in joomla provided by community edition. there is a way to retrieve the creation date of the article? – Gabriel91 Sep 1 '16 at 14:09
  • the problem also exists to call the url of an image of the article – Gabriel91 Sep 1 '16 at 14:11
  • It definitely sounds like you are using the wrong syntax. I've added some additional info from Weelbr's documentation which may help. – Michael Yaeger Sep 1 '16 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.