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

Translatable #4

Open
dacar opened this issue Jan 23, 2015 · 3 comments
Open

Translatable #4

dacar opened this issue Jan 23, 2015 · 3 comments

Comments

@dacar
Copy link

dacar commented Jan 23, 2015

There is a problem if you use the translatable module with silverstripe--calendar. The URL segment is in some cases, e.g. on save a page, broken: http://www.pcguth.de/test2014/admin/calendar/?locale=de_DEpastevents/

Can you give advice to fix it?

@anselmdk
Copy link
Member

I think it might have something to do with the way I tweaked the backend, e.g. here:
https://github.com/titledk/silverstripe-calendar/blob/1.0/templates/Includes/CalendarAdmin_Tools.ss#L12

Probably that would need some tweaking either of those links or figuring out what the translatable module is doing to links.

@xini
Copy link

xini commented Jan 29, 2015

@anselmdk: Just use Controller::join_links() to create your links. You can create methods in your CalendarAdmin like

public function PastEventsLink() {
    return self::join_links($this->Link(), 'pastevents');
}

[untested]

and in your template you can call $PastEventsLink instead of {$Link}pastevents/.

Controller::join_links() takes care of correctly joining any existing or new URL segments and parameters.

@anselmdk
Copy link
Member

@xini nice, thanks! I'll look at this next time I'll work with the calendar - if no-one sends a pull request before that ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants