joppedc / syliusbetterseoplugin Goto Github PK
View Code? Open in Web Editor NEWSEO Plugin for Sylius products and taxons
License: MIT License
SEO Plugin for Sylius products and taxons
License: MIT License
Currently we're using javascript to create meta tags in the header, from the body.
The cleanest way would be if we could render the _seo_block
directly in the header itself.
This can be done using the sonata block render event sylius.shop.layout.head
. The problem is that we can't access the product in this context.
_seo_block
render to headFollowing installations steps, doctrine:migrations:diff
throws this error:
In SchemaException.php line 108:
The table with name 'sylius.sylius_product' already exists.
Let me know (ping me here in GitHub) if you add/remove/modify translation keys in the future, so I can update it.
We should add some behat tests to cover some basic scenarios.
Hi, I install the plugin on my Sylius test website, I read the docs and when I override Taxon I've got a 500 error on my server.
Log of the error :
[2020-12-10T15:17:44.012086+01:00] php.CRITICAL: Error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't1.seo_id' in 'field list' in /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115 Stack trace: #0 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute() #1 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1255): Doctrine\DBAL\Driver\PDOStatement->execute() #2 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(750): Doctrine\DBAL\Connection->executeQuery() #3 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(768): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load() #4 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php(159): Doctrine\ORM\Persisters\Entity\Basic {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't1.seo_id' in 'field list' in /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115\nStack trace:\n#0 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute()\n#1 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1255): Doctrine\\DBAL\\Driver\\PDOStatement->execute()\n#2 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(750): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(768): Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister->load()\n#4 /mnt/j/Professionel/Developpement/casaya/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php(159): Doctrine\\ORM\\Persisters\\Entity\\Basic at /mnt/j/Professionel/Developpement/casaya/vendor/sylius/resource-bundle/src/Component/Model/TranslatableTrait.php:53)"} []
IMHO I don't have the seo_id on taxon table, I think something done wrong when I do my doctrine:migrations:migrate
but I don't find where the problem.
My Version20201210132508.php after my doctrine:migrations:diff
:
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20201210132508 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sylius_product ADD seo_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE sylius_product ADD CONSTRAINT FK_677B9B7497E3DD86 FOREIGN KEY (seo_id) REFERENCES joppedc_seo (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_677B9B7497E3DD86 ON sylius_product (seo_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sylius_product DROP FOREIGN KEY FK_677B9B7497E3DD86');
$this->addSql('DROP INDEX UNIQ_677B9B7497E3DD86 ON sylius_product');
$this->addSql('ALTER TABLE sylius_product DROP seo_id');
}
}
Is someone can help me please?
If we add an image to the SEOTranslation, we could use this for both og:image
and twitter:image
. If there's no image set, we can fallback on the first product image.
Need to add some installation docs for users wanting to use this in their projects.
In order to provide the most flexibility, the changes we made to the product entity should be done using a trait. This way, when a user overrides the Sylius Product model, all they have to do is add the trait to get the required fields.
An update is planned for sylius 1.11 and php 8.1 ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.