? Pending

User tests: Successful: Unsuccessful:

avatar alexgarel
alexgarel
3 Sep 2016

Pull Request for Issue #11792.

Summary of Changes

In language module, Add a "lang-associated" class to languages that have a content associated to current content.

Note that this PR just provide the class, but does not use it in css (as it's already the case with the "lang-active" class).

Combined with a specific css (up to the template) this can help the visitor guess that changing language will take it to some other content (the parent menu or the homepage)

An example after using opacity in css to mark the difference with protostar (EN is active, FR is associated but not IT):

ml-lang-switcher-01

ml-lang-switcher-02

Testing Instructions

  • In a multilinguale site, add a category with associations in different languages (but not all), an article and associations in different languages (but not all).

  • optionally add this custom css to your template:

    .lang-inline a {
    opacity: .5;
    }
    
    .lang-inline .lang-active a, .lang-inline .lang-associated a {
    opacity: 1;
    }
  • Add the language switcher module to your site (using flags).

  • Go to category / article with association. Verify language module entries corresponding to associated languages have the "lang-associated" class

  • change language switcher module settings to display languages

  • Go to category / article with association and verify again

  • Change template to beez

  • Go to category / article with association and verify again

You can use this dataset :
joomla-ml-sample-sql.zip
it provides a en/fr/it site where main page is fully associated, while a category named glossary is only associated with french. Articles inside glossary are either associated with french (joomla / cms) or with none (free and opensource)
login: test@example.com / test

Documentation Changes Required

I don't think (but I'm quite new to joomla)

avatar alexgarel alexgarel - open - 3 Sep 2016
avatar alexgarel alexgarel - change - 3 Sep 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Sep 2016
Category Front End Modules
avatar joomla-cms-bot joomla-cms-bot - change - 3 Sep 2016
Labels Added: ?
avatar alexgarel alexgarel - change - 6 Sep 2016
The description was changed
avatar alexgarel alexgarel - edited - 6 Sep 2016
avatar alexgarel alexgarel - change - 6 Sep 2016
The description was changed
avatar alexgarel alexgarel - edited - 6 Sep 2016
avatar alexgarel alexgarel - change - 6 Sep 2016
The description was changed
avatar alexgarel alexgarel - edited - 6 Sep 2016
avatar alexgarel alexgarel - change - 6 Sep 2016
The description was changed
avatar alexgarel alexgarel - edited - 6 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - change - 6 Sep 2016
Category Front End Modules Front End Modules Templates (site)
avatar alexgarel
alexgarel - comment - 6 Sep 2016

@infograf768 @brianteeman I think this PR is low-cost and is complementary to #11935.
So I think its still worth.

Would you mind looking at it ?
I put a sql file for quick testing (I didn't find any true multilingual base sample).

avatar infograf768
infograf768 - comment - 6 Sep 2016

i guess you could add here a screenshot of the result for each situation plus the new class to add in the template css to check what you want to reach. then will test.

avatar alexgarel
alexgarel - comment - 6 Sep 2016

ok will do.

avatar alexgarel alexgarel - edited - 6 Sep 2016
avatar alexgarel
alexgarel - comment - 6 Sep 2016

This should be ready for testing.

avatar infograf768 infograf768 - test_item - 7 Sep 2016 - Tested successfully
avatar infograf768
infograf768 - comment - 7 Sep 2016

I have tested this item successfully on f402f1d


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11914.

avatar alexgarel
alexgarel - comment - 15 Sep 2016

@Bakual @mbabker could you have a look at this PR. It is somewhat related to #12042 but a complementary solution with lightweight changes.

avatar Bakual
Bakual - comment - 15 Sep 2016

Looks fine to me, but why did you remove it for the menu item associations?

avatar alexgarel
alexgarel - comment - 15 Sep 2016

I remove the menu item association because the scope is to know that an item is translated (changing language won't send me elsewhere, but on a corresponding item in my language).
When you switch language, menu item association enable landing less far away that going back to home, but this does not tells you that current item is translated. Menu association will be evaluated even if you are reading a non translated article after navigating to it inside a menu, so that's the wrong information.

avatar Bakual
Bakual - comment - 16 Sep 2016

I was just thinking that it could still be a useful information to differentiate it from a link that just gives you the homepage.
What do you think about using two different classes, one for an associated item and one for an associated menu? Looking at your code you could just assign a string (eg lang-associated-item and lang-associated-menu) instead of true to the $language->associated property and then directly use that as class.

avatar alexgarel
alexgarel - comment - 28 Oct 2016

Hi, I would like to rework on this, trying to do this better.
Anyone could tell me the right way to verify if I'm currently displaying the page corresponding to the active menu or a page under it. (eg. If the menu displays list of article, knows if I'm currently displaying this or an article inside the list).

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 May 2017

@alexgarel should this PR be tested or are you on rework?

avatar alexgarel
alexgarel - comment - 28 May 2017

Hi @franz-wohlkoenig, It would have been to be reworked. Nobody respond to my question above though. Also I'm not a regular php programmer. So atm I can't find time to continue on this.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 May 2017

@alexgarel so please close this PR in the Time you reworke it. Please reopen this PR or open an new one after you have finished.

avatar alexgarel
alexgarel - comment - 28 May 2017

ok, I close it.

avatar alexgarel alexgarel - change - 28 May 2017
The description was changed
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-05-28 15:35:32
Closed_By alexgarel
avatar alexgarel alexgarel - close - 28 May 2017

Add a Comment

Login with GitHub to post a comment