Alright, I was working on getting this ready for production. Using SEF URLs it was working great, without SEF problems... why? Well let's look at the code:
Code:
$list[$k]['link'] = JRoute::_('index.php?option=com_flexicontent&id='.intval($v->item_id));
Now, I know there is a helper, but I know exactly how the URLS will be, and I am really against using menu items here because it will kill SEF because you will end up have duplicate pages with different urls. This is actually true anytime you use SEF urls, but also even worse because a file can be in multiple categories in flexicontent. This link actually shouldn't work because no view is defined, but in SEF mode it does, more on that in a minute.
So I changed it to this:
Code:
$list[$k]['link'] = JRoute::_('index.php?option=com_flexicontent&view=items&id='.intval($v->item_id));
but this will complain to so looking at the router.php file for flexicontent, it seems you need to do this:
Code:
$list[$k]['link'] = JRoute::_('index.php?option=com_flexicontent&view=items&id='.intval($v->item_id).'&Itemid=-1');
I should not have to have a menu item to link to an article, this makes no sense
Code:
So lets look at line 76 in router.php:
$view = $query['view'];
if(empty($query['Itemid'])) {
$segments[] = $query['view'];
}
This line is what make no sense to me, actually the entire router file for the most part really confuses me. Wait... no it seems I am confused again with where I was going in this router file, why aren't I developing in my vm with the debugger... Let me regroup my thoughts here.
Here is the problem a url should work whether it is normal or converted to SEF
for example:
index.php?option=com_flexicontent&id=82
is not a valid link, but if you put that into JRoute::_() and have SEF turned on, that link will work (Line 109 in the router.php), there is something really wrong.
I am sadly beginning to notice some really weird coding going on with flexicontent which is driving me nuts, (for example what is the rationale for there being sql in the controller and not as a function in the model?). I am having a really hard time figuring the logic, from a developers stand point this is a real pain to work with.
In less ranty news, I am going to keep working on this and see if I can get it to where it works and makes sense to me and then release it and everyone can just tell me where the bugs are then.
Edit:
Bug filed:
joomlacode.org/gf/project/flexic
... m_id=19609
Maybe someone will explain to me what's going on.