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

Slugging and translations #54

Open
lupuswwww opened this issue Nov 20, 2024 · 1 comment
Open

Slugging and translations #54

lupuswwww opened this issue Nov 20, 2024 · 1 comment

Comments

@lupuswwww
Copy link

lupuswwww commented Nov 20, 2024

In the application I am working on, I can fetch records in the default language without any problems, but I am unable to do so in the translated languages. A simplified PHP code looks like this:

public function index($slug=null)
{
$this->ServiceUnits = $this->fetchTable('ServiceUnits');
$serviceUnit = $this->ServiceUnits->find('slugged', slug: $slug)->first();
}

CREATE TABLE IF NOT EXISTS service_units (
id int NOT NULL AUTO_INCREMENT,
title varchar(255) DEFAULT NULL,
text text,
slug varchar(100) DEFAULT NULL,
active tinyint(1) NOT NULL DEFAULT '0',
position float DEFAULT NULL,
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS service_units_translations (
id int NOT NULL,
locale varchar(5) NOT NULL,
title varchar(255) DEFAULT NULL,
text text,
slug varchar(100) DEFAULT NULL,
PRIMARY KEY (id,locale)
);

How can I retrieve data from the service_units_translations table using the 'Slug' plugin?

@lupuswwww
Copy link
Author

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

No branches or pull requests

1 participant