2013-05-05, 19:59:04
(2013-05-05, 15:37:16)mvlcek Wrote: The second parameter should be the parent or null. In your case it outputs the current language and the parent (both 'en').
Ohhh gracias, that explains all the problems I experienced.
Without 2nd parameter I was getting warning with missing argument 2, and I assumed it cannot be just ... NULL. It's not always possible to know the parent when pages are being moved.
(disabling error reporting with @ prefix is - you know ... not the way of fixing anything)
(2013-05-05, 12:12:16)yojoe Wrote: 2. I wanted to get a standalone link to parent (in respective language), and show it on all its slugs.Yes, the code was supposed to always show top parent in a tree of nested pages, regardless of currently visited slug, and also while visiting the parent page.
Is there maybe a builtin' function for this, rather than using below sample code ?
[quote='mvlcek' pid='36135' dateline='1367732236']
Your code gives a link to top-most ancestor (if you are on third level or below) - and the second parameter to find_i18n_url is wrong again. In general you don't need to specify the language, if it should not change.
get_i18n_link only shows parent of current slug if the slug has any.
(2013-05-05, 15:37:16)mvlcek Wrote: If you use fancy urls, use the newest plugin version 3.1.1.
Updated, everything works fine.
Thanks again
Addons: blue business theme, Online Visitors, Notepad