Comments (5)
Hi! I'm going to expand on this.
In the Image Element this properties are set:
const ASPECT_FIT = 'aspect-fit';
const ASPECT_FIT_ONLY = 'aspect-fit-only';
const FULLSCREEN = 'fullscreen';
const NON_INTERACTIVE = 'non-interactive';
The same way they are on the Video Element.
Even there is the withPresentation function, that has been duplicated from the Video Elemento because the comment has the Video on it:
/
**
* Sets the aspect ration presentation for the video.
*
* @param string $presentation one of the constants ASPECT_FIT, ASPECT_FIT_ONLY, FULLSCREEN or NON_INTERACTIVE
* @see Image::ASPECT_FIT
* @see Image::ASPECT_FIT_ONLY
* @see Image::FULLSCREEN
* @see Image::NON_INTERACTIVE
*
* @return $this
*/
public function withPresentation($presentation)
{
Type::enforceWithin(
$presentation,
[
Image::ASPECT_FIT,
Image::ASPECT_FIT_ONLY,
Image::FULLSCREEN,
Image::NON_INTERACTIVE
]
);
$this->presentation = $presentation;
return $this;
}
But in the ImageRule Transformer, the rules for the properties are missing, specifically this:
if ($this->getProperty(Image::ASPECT_FIT, $node)) {
$image->withPresentation(Image::ASPECT_FIT);
} elseif ($this->getProperty(Image::ASPECT_FIT_ONLY, $node)) {
$image->withPresentation(Image::ASPECT_FIT_ONLY);
} elseif ($this->getProperty(Image::FULLSCREEN, $node)) {
$image->withPresentation(Image::FULLSCREEN);
} elseif ($this->getProperty(Image::NON_INTERACTIVE, $node)) {
$image->withPresentation(Image::NON_INTERACTIVE);
}
I added them and worked perfectly.
from facebook-instant-articles-sdk-php.
I tried, but I'm not an approved contributor so I can't make PRs :(
from facebook-instant-articles-sdk-php.
@marianop Can you send a PR with that fix?
from facebook-instant-articles-sdk-php.
@marianop What do you mean?
If you follow the steps here, you will be promoted as a contributor:
https://github.com/facebook/facebook-instant-articles-sdk-php/blob/master/CONTRIBUTING.md
Let me know if you have any problem on these steps.
from facebook-instant-articles-sdk-php.
Fixed in PR #147
from facebook-instant-articles-sdk-php.
Related Issues (20)
- Failed Connection with graph.facebook.com HOT 2
- Handling of Ads Settings fields
- Support paragraphs inside Blockquote
- FAN on AMP? HOT 2
- Validate Analytics Configuration
- Installation problem on laravel 5.6 HOT 1
- RTL problem HOT 2
- Unable to use ConstantGetter with InteractiveRule HOT 4
- autoplay video in fullscreen HOT 1
- Transformer's transform method does not account for settings
- Problem in rule "multiple" - IA HOT 3
- Query params in related articles
- [BUG] : Problem with the Span and Anchor Rule
- Travis CI Php 5.5 and Php 5.4
- Fetch
- Integration in Symfony 5 is not possible because of css selector version in composer.json HOT 1
- FBInterstitialAd is gives all time "server error"
- support php 8 HOT 2
- Use InstantArticleInterface instead of InstantArticle as parameter type for Transformer methods
- How to create a scheduled facebook instant article through PHP SDK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-instant-articles-sdk-php.