Flexicontent Latest News Module

More
16 years 3 weeks ago #3332 by WebDesignHero
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.

Please Log in or Create an account to join the conversation.

More
16 years 3 weeks ago #3373 by WebDesignHero
Tried importing and using the helper:
Code:
include_once('components'.DS.'com_flexicontent'.DS.'helpers'.DS.'route'.'.php'); $list[$k]['link'] = JRoute::_( FlexicontentHelperRoute::getItemRoute($v->item_id) );

but it gives me the exact same links as I was having problems with...I am not sure what's going on, I should be generating the same links from the output of the helper no?

Again, short rant - clean up the code a bit... this is a simple problem which should not exist.

Edit 1:

Okay, I see what is happening. These items are categories which are not set to any Itemid.

What is happening with subcategories, is that they reuse the Itemid instead of the category.

So for example I navigate to a page with Itemid=24 which is called "first-menu"

That menu-link points to a category view and when you navigate to the children it keeps the item id! So I click on a subcategory and the SEF url will still show "first-menu" which is probably irrelveant, it doesn't even do something like "first-menu/subcategory"

So if i have item 100 called "foo" in a subcategroy I would really expect

toplevelCategory/subcategory/item

While having the nested categories is nice for organization, it should be reflected in the URLs as well. This lack of knowledge in the hierarchy also is probably the reason that the breadcrumbs fail.

So, even using the built in helper is useless in this case becuase of a needless dependence on Itemid.

Please Log in or Create an account to join the conversation.

More
16 years 3 weeks ago #3463 by Olinad
As you seem pretty good at coding... have you any idea on how to adapt this related news module so that it works with FLEXIcontent's TAGs only?

extensions.joomla.org/extensions ... items/6195

Please Log in or Create an account to join the conversation.

More
16 years 3 weeks ago #3519 by ComposerRyan
Are you planning on releasing the Latest News module in the next couple of days? It has been a very long wait for this one and I am excited to see how it will integrate with Flexicontent!

Please Log in or Create an account to join the conversation.

More
16 years 2 weeks ago #3626 by WebDesignHero
It doesn't look like I will be releasing this because flexicontent's router is really bad and I just can't figure out how to make it work properly.

Please Log in or Create an account to join the conversation.

More
16 years 2 weeks ago #3627 by WebDesignHero
Without modifying your router.php file to this:
Code:
$view = $query['view']; if(empty($query['Itemid'])) { //$segments[] = $query['view']; }

it will not work, so I can't release my mod until this big has been addressed.

Someone can try to get more attention to it:
joomlacode.org/gf/project/flexic ... m_id=19609

The other problem is that for some reason it won't just use the active menu id, even though it calls it.. it seems to set it to some variable, but doesn't replace it where it might be needed. However, that would be the wrong behavior anyway because it adds the current menu id in front of the current item, which would be wrong.

Please Log in or Create an account to join the conversation.

More
16 years 5 days ago #4033 by micker
it is in french but you have this module to adapte to flexicontent (is very powerfull then last module)
www.flexicontent.org/forum/index ... =viewtopic
some help is interessting
Thanks a lot

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #4393 by WebDesignHero
The module above has a little more granular control I did not put in yet (e.g. published state, etc.) so give it a try.

I looked through his code to see if there is a solution for the Itemid nonsense (Joomla's worst feature)
Code:
$Itemid = $mainframe->getItemid( $row->id, 0, 0, $bs, $bc, $gbs );

Since I have always avoided Itemdid I am not sure how to utilize this, but it might help solve my problem to assign a proper id, but I highly doubt it because of the multiple possible sef problem.


micker, and other members of the flexicontent team:

please stop putting so much php and code into the template file where it does not belong, this makes it much harder for developers to modify it to their own template using template overrides because they need to deal with all the code, you should really just be echoing.

Actually designing with MVC would actually be nice too.

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #4394 by Olinad
The module above has been edited by me and now supports (almost) any of FLEXIcontent's features. You can find it in the Extensions - Modules forum.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save