[Resolved] Switch between category views

More
13 years 6 months ago - 13 years 5 months ago #10984 by kharmer
Hi all,

I am a new user of FlexiContent as of today.

I've jumped right in and have managed to get things the way required very easily, so well done for an excellent Joomla extension.

One question I have is as follows:

I have 2 categories populated with the same items all as the same 'type'; one category is default to all these items.

I have also created 2 seperate templates, one for each category. They have identical 'Item' layouts but very different 'Category' layouts.

When a user comes to this section they are presented with the items default category layout.

What I'd like to do is provide a link at the top of the category layout allowing the user to view the other category. This other category has the same items but in a different category layout template.

I'm sure this is doable but wasnt quite sure how I should go about it within FlexiContent.

Any pointers would be highly appreciated.

Kind regards,
Kris...
Last edit: 13 years 5 months ago by kharmer.

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

More
13 years 6 months ago #10985 by kharmer
I was kind of thinking how I could have the two categories related and then show 'related categories' on each category layout.

Also, to clarify what I mean by 'different' category layouts; one category view is to list items as text in a list and the other is to list the same items as thumbnail images only. ;o)

Thanks,
Kris...

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

More
13 years 6 months ago #10987 by kharmer
OK, I have managed to do this quite easily, just by adding a new DIV and adding links to both categories.
Code:
<div id="viewswitcher"> [url=<?php echo( 'index.php?option=com_flexicontent&view=category&cid=3&Itemid=19' ); ?>]List view[/url] [url=<?php echo( 'index.php?option=com_flexicontent&view=category&cid=4&Itemid=19' ); ?>]Thumbnail view[/url] </div>

One thing I did notice was that the non-default category SEF URL included the category ID! I know I can install SEF404 or equivelant to be able to edit this but is there another way to change a SEF URL from FlexiContent (tried jroute())? I like to use the native SEF support Joomla comes with!

Thanks,
Kris...

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

More
13 years 6 months ago #10991 by effrit
hi,kharmer
i think if you want change just layout of category view you must edit the template, instead of makind double of categories.
so in the end you will have one category template with dinamic changing of view.
yes, you must use your head and take some php knowledge, but its price for real flexibility :)

for example, you may use dropdown list and push choosed value to cookies or session and make redirect to the same page.
and in your "universal" template you must insert condition:
Code:
if (isset($_COOKIE['choose'])) $template=$_COOKIE['choose']; if ($template=="first") { draw first template part} else { draw second template part}
you may try this module.
i made it to experimental purpose. the module itself just make dropdown list and push to cookies value in according to choosed item. after pushing to cookie page refreshing or redirected to main page

_http://zalil.ru/29748633 - link to downloading module. just wait 3-8 second and downloading will starting

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

More
13 years 6 months ago #10992 by kenmcd
.
Thanks effrit.

It is OK to and recommended to attach files here.
That way the file will still be available months from now.

[attachment=0:2p93qg5q]<!-- ia0 -->mod_anychooser.zip<!-- ia0 -->[/attachment:2p93qg5q]

.
Attachments:

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

More
13 years 6 months ago #11195 by kharmer
Thanks for the replies.

You were right in that adding the items to a secondary category to achieve this was not ideal.

In the end, I kept these items in the single parent category and simply placed two links to the top of the tamplate.

One linked to the current default view and the other linked to the same view but with an additional parameter on the end.

I then check for this parameter in my view template and show the relevant layout.

Also, when I was defining my 'zones' in this view/template; it dawned on me that I didnt 'have to have them' in my template just because I had defined them. So for example, I could have the zone called image but only use it under certain conditions in my template without errors etc.

Thanks for offering the code effrit, however it wasnt needed in this case. The thumbnail view was always to be default and the list view was just there for user preference.

Regards,
Kris...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.300 seconds
Save
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