I am trying to figure out the Seblod SEF Router. What I would like to do is build an SEF URL, based on the following properties: itemid, catid, id, (view=article). I would like the generated URL to be the same as the one Seblod SEF generated automatically (I have set Seblod SEF Router setting to 'parent/alias').
Is there any easy way to use the Seblod Router class to build a SEF URL based on the values that I have? What I have done is created a function under the content type/item view to show previous/next buttons. I use a DB query to find the previous and next article, and retrieve it's associated information.
This works fine, but the URL rewriting does not.
When I vardump the $query array (Seblod router.php), I get the following (one example):
This does 'work', but it changes itemid to be 101 (even though itemid is passed to JRoute, I have the menu item!), but also meta attributes (<title> tag) be that of the homepage. The most obvious problem is it very different to what Seblod generates.
The only way for this to work is to not use SEF urls for this request at all, which I would like to avoid doing.
I've spent the last while now trying to figure out Seblods SEF routing code but to no avail. Am I missing something obvious here? Any help is appreciated :)
Well, I figured this out and will share the solution for those interested. It was actually rather simple. The Seblod Router.php will call a plugin based on the content being passed to it (e.g: joomla_article.php). Inside of joomla_article.php there is a static method: getRoute. (If you were looking up a user for e.g, there is another storage location plugin).
All you need to do is pass the Article ID, SEF number (figure this out from the source code) and itemid.
For example, for a Joolmla Article type you would use: