Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put multiple versions of the same tag #16583

Merged
merged 5 commits into from
Jul 19, 2017
Merged

Conversation

kernusr
Copy link
Contributor

@kernusr kernusr commented Jun 8, 2017

Pull Request for Issue # .

Summary of Changes

Changed the type of the parameter $content from a string to an array in the setMetaData method of the JDocument class.
This will allow you to add multiple identical tags with different values. For example og:image (http://ogp.me/#array)

Testing Instructions

Call in your code
JFactory::getDocument()->setMetaData("og:image", array("/image1.jpg", "/image2.jpg", "/image3.jpg"), 'property');

Expected result

View the source of the page in the browser.
You should see the following code in head:
<meta property="og:image" content="/image1.jpg" /> <meta property="og:image" content="/image2.jpg" /> <meta property="og:image" content="/image3.jpg" />

Documentation Changes Required

https://api.joomla.org/cms-3/classes/JDocument.html#method_setMetaData
Replace this:

$content string Value of the meta HTML tag
with this:

$content mixed Value of the meta HTML tag as array or string

@ghost
Copy link

ghost commented Jun 8, 2017

@kernusr can you please write the "Summary of Changes" also in English – thanks.

@kernusr
Copy link
Contributor Author

kernusr commented Jun 8, 2017

@franz-wohlkoenig oops! Sory

// B/C old http_equiv parameter.
if (!is_string($attribute))
{
$attribute = $attribute == true ? 'http-equiv' : 'name';
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove tabs.

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on bb096d5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16583.

@Quy
Copy link
Contributor

Quy commented Jun 22, 2017

I have tested this item ✅ successfully on 9ba276b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16583.

@Quy
Copy link
Contributor

Quy commented Jun 22, 2017

@franz-wohlkoenig Please RTC as the last change was to remove tabs which would not affect the test result. Thanks.

@joomla-cms-bot joomla-cms-bot changed the title put multiple versions of the same <meta> tag put multiple versions of the same tag Jun 22, 2017
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 22, 2017
@ghost
Copy link

ghost commented Jun 22, 2017

RTC after two successful tests.

@zero-24 zero-24 added this to the Joomla 3.7.4 milestone Jun 22, 2017
@rdeutz rdeutz modified the milestones: Joomla 3.8.0, Joomla 3.7.4 Jul 11, 2017
@mbabker mbabker changed the base branch from staging to 3.8-dev July 19, 2017 12:15
@mbabker mbabker merged commit 26a6239 into joomla:3.8-dev Jul 19, 2017
@joomla-cms-bot joomla-cms-bot added PR-3.8-dev and removed RTC This Pull Request is Ready To Commit labels Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants