Comments (7)
Seems like @seo()
uses seo()->set()
, and Flipp needs to be used via seo()->flipp()
. It then calls set()
for 'image'
:
laravel-seo/src/SEOManager.php
Line 180 in 754b393
from laravel-seo.
Sure, but flipp()
requires 2 parameters, how to do that with the @seo
array parameter?
from laravel-seo.
Ah hmm, seems like @seo
uses flipp()
correctly, it doesn't call set()
:
laravel-seo/src/SEOServiceProvider.php
Lines 34 to 40 in 754b393
I think the right syntax is @seo('flipp', [ array data ])
. When you pass an array to @seo
, there's no first argument indicating that this is a flipp()
call, so it goes straight to set()
.
from laravel-seo.
But @seo('flipp', [ array data ])
will output the image URL. I just want to define the social image on one view which is then used by the meta tags in the laout, exactly like @seo(['title' => 'Test123'])
.
To make it more clear. Here's an example:
@seo([
'title' => 'Hello World',
/* not possible */ 'flipp' => ['blog', ['headline' => 'Lorem Ipsum', 'teaser' => 'Lorem Ipsum, Lorem Ipsum']]
])
<x-layout>Some content</x-layout>
The @seo
tag seems to only support strings for values, but the flipp and previewify functions need more parameters.
from laravel-seo.
Ahh I see. Yeah hmm so:
- array syntax (
@seo([...])
) is used for setting values rather than outputting stuff - arrays get passed to
set()
So the blade directive should probably check if a passed array has a flipp
key, and then call the flipp()
method and exclude it from the data passed to set()
?
from laravel-seo.
That's a possible approach, but the same for previewify.
from laravel-seo.
Perhaps your PR could check for the presence of flipp
and previewify
in this array ($args[0]) too?
laravel-seo/src/SEOServiceProvider.php
Lines 47 to 52 in d12038f
from laravel-seo.
Related Issues (15)
- Include URL tags
- Is it possible to use different content for the title and the og:title? HOT 6
- Possible to change the og:type HOT 5
- Document changes added in v0.4.0 HOT 1
- HTML tag spacing strange HOT 2
- seo()->tag() for custom meta tags without extensions HOT 1
- [FEATURE] Favicon support HOT 6
- Appears to be vulnerable to XSS HOT 2
- Edit everything myself HOT 1
- Trailing slash on void elements has no effect and interacts badly with unquoted attribute values. HOT 1
- Laravel Octane - values leaking from prior requests
- Raw tags cannot be overridden HOT 1
- Multifunctional methods HOT 1
- Fixing all PHPStan problems HOT 1
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 laravel-seo.