简体   繁体   中英

Joomla article layout change base on navigation

I tried search lot on net but failed to got any solution.

Actually I want to change layout in my joomla article based on the user navigation.

For an example let say if user visiting iPhone Case studies & click on any case study(eg: Angry Bird) it contains the images/slideshow of angrybird project in iphone screen, while if the same article visit from iPad case studies page it contains horizontal image of ipad screen (Note: layout is changed).

To be short - I need the content & layout change in same article base on navigation or condition.

Is there any plugin or component which will help me to achieve this ? Any help will be appreciated.

Thanks

I think the easiest solution for this problem would be to use two different articles for each of the above said cases. That way you can easily style either of the cases the way you want. And by using one article for it, I see no particular advantage, as opposed to using different articles. If you see of any particular advantage please share it with us. In any case if you want it to still use a single article, it seems to me that it would be a more complex solution. From what I know, there does not exist a plugin or component to cater your particular use case.

A quick and dirty solution, that comes into my mind includes the Jumi extension, which you can find here: http://extensions.joomla.org/extensions/1023/details . Jumi allows you to include PHP in your articles, etc..

You can then make an user-agent check and output everything as you need it for that particular device and for that particular article.

If you need different templates/layouts for both devices, I would recommend a theming framework, which does these things for you (applying different layouts for different devises). The T3 Framework from Joomlart does these things pretty well: http://www.joomlart.com/joomla/t3-framework-and-ja-purity-templates

I think the answer to your problem is 'Layout overrides'. Just create a layout override for the article component in the particular template folder you use for your inner-pages. I think you should read through the following Wiki pages for a more clear understanding-

Joomla 1.5- http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

Joomla 1.6(Should be applicable for 1.7 as well)- http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6

Hope that this solves your problem. Cheers.

I have seen another post here on Stackoverflow. Which says we can append page-class suffix to the tag. So as to style each article the way we we want, based on menu ids. This may be easier than a Layout override. Check out- Joomla : How can we assign a different layouts to different menu IDs?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM