pepperstreet VIP
Total posts: 3,837
02 Сен 2014 21:35

Hello, I have played with Cobalt section homepage and user's homepage. Also with respective links in "My Menu" and "Personalization". The latter activates the "homepage" link on usernames. I think, I have found a small but important issue with the "ItemID". Or should I say: It lacks an obvious feature/behavior ?!

Issue

If Personalization is ON, and there is even a separate J! MenuItem pointing to the user's homepage...
it does not use that ItemID in:

  • Section menu -> My Menu -> My homepage
  • Section list -> link on username -> See all articles

Both links inherit the ItemID from the regular section list :( Maybe this behavior makes sense for a setup without MenuItem for "User's homepage" and with Personalization OFF.

Idea & suggestion

But in the other case it should respect the NEW ItemID. If not automatically, I would suggest a new Section parameter in tab "Personalization". Similar to the other "target ItemID" parameters... but here I can select a respective "User's homepage" menuItem.
(An optional setting is best, because some use cases or sections may work with the inherited ItemID. Even with Personalization ON)

Benefits

  • This allows different page layouts and module assignment for section list and user's homepage.
    i.e. creating a dashboard with records modules, or user related modules with infos, followers etc.
  • More space, no more line-breaking of tabs!
    i.e. User's homepage menu has many tabs and items. I can display a 100% width menu on user's homepage, and regular section list may have a module sidebar. I can hide unwanted modules to my liking.

Последние изменения: 10 Фев 2017



pepperstreet VIP
Total posts: 3,837
02 Окт 2014 00:31

Do we get a solution/feature in Cobalt 8 or is it scheduled for Cobalt 9 ?


Sergey
Total posts: 13,748
02 Окт 2014 01:50

Cobalt 9


pepperstreet VIP
Total posts: 3,837
02 Окт 2014 02:43

o.k., until then... Can you give a hint how to change the "list template" for "User's homepage" context?

A) I guess, via j!App variable or Jinput/URL.
B) If there is a J! menuItem, maybe by checking the current active menuItem?

But how would I set a particular list template?
Can I set a different ItemID programatically as well?


Sergey
Total posts: 13,748
03 Окт 2014 01:43

pepperstreet But how would I set a particular list template?

This is whole system. Set of parameters have to be attached to every template with unique key.It is not thus simple to do on your own. I have to make special parameter like template for owner of the user homepage and apply that template there.

pepperstreet Can I set a different ItemID programatically as well?

Depends where you whant it. But yes in most of the cases.


pepperstreet VIP
Total posts: 3,837
03 Окт 2014 15:43

Sergey This is whole system. Set of parameters have to be attached to every template with unique key.It is not thus simple to do on your own.

Mmh. How does it work for the template (view) switcher? If I can switch by a simple click... I thought I can trigger the same thing by code in a custom template.


Sergey
Total posts: 13,748
06 Окт 2014 03:07

You have to configure every template in switcher.


pepperstreet VIP
Total posts: 3,837
06 Окт 2014 03:37

Sergey You have to configure every template in switcher.

Sorry?

Actually, the view switcher contains ALL templates.
Including the special template for user's homepage section list.

How does the view switcher work? I mean, I won't CLICK and select a template from the switcher manually. I want to call a view by code. (programatically)

I think, you do something similar with the DEFAULT view template. It is an extra parameter. How do you set this default?


Sergey
Total posts: 13,748
07 Окт 2014 01:37

pepperstreet Actually, the view switcher contains ALL templates.

Give me a screenshot. I do not understand what switcher you ask about.


pepperstreet VIP
Total posts: 3,837
07 Окт 2014 03:22

Sergey Give me a screenshot. I do not understand what switcher you ask about.

For section list view, you can select multiple templates. And also 1 default template.

If multiple template were selected, you will get the "template switcher" in section menu bar.
The view dropdown menu contains all selected list templates e.g.:

"default"
"blog"
"Adv. Table"

In frontend I can select a view/template in the dropdown menu. The list view changes accordingly.

Question:

How can I call/trigger that template change in a custom (markup) template?

Example/Usecase

Check URL for user's homepage context. Maybe check "view_what", "current user", or active menuItem. If I am on MY user's homepage URL, set a certain list view template.


Sergey
Total posts: 13,748
07 Окт 2014 03:48

You can see HTML source on switcher.

<a href="javascript:void(0)" onclick="Cobalt.applyFilter('filter_tpl', 'blog.ff92fb53e46589895cfbf216d585010c')">
    Blog                                                                                
</a>

And now you can create custom prefiltered lisn and use filter_name[0]=filter_tpl&filter_val[0]=blog.ff92fb53e46589895cfbf216d585010c.


pepperstreet VIP
Total posts: 3,837
10 Июнь 2015 20:50

Check URL for user's homepage context. Maybe check "view_what", "current user", or active menuItem. If I am on MY user's homepage URL, set a certain list view template.

Related question and some need for confirmation ;)

What's best practice? How do I check "programatically" for the user homepage context?

Purposes:

  • load specific modules/positions only on user's homepage
  • conditional display of certain infos and data (for owner only, for visitors only)

Sergey
Total posts: 13,748
11 Июнь 2015 04:42

pepperstreet How do I check "programatically" for the user homepage context?

I think the best way would be through check of the URL parameters. The URL of homepage looks like this.

index.php?option=com_cobalt&view=records&section_id=4:test-section&user_id=815:sergey&view_what=created

So i would check that if option is equal to com_cobalt and view is equal to records and there is user_id in url and view_what is equal to what you need.

$input = JFactory::getApplication()->input;
if($input->get('option') == 'com_cobalt' && $input->get('view') == 'records' && $input->getInt('user_id') > 0 
    && $input->get('view_what') == 'created')
{
    /// Show modules
}

pepperstreet VIP
Total posts: 3,837
14 Июнь 2015 13:36

Bug?

Apart from the initial topic and the same ItemID issue, there is another problem I was not aware of:

  • You can't display ANY module in User's Homepage context?! Although there is a respective Joomla MenuItem of this specific menutype.

Try this:

  • Create a menu of type Cobalt 8 -> User Articles (User's homepage within a section).
  • Create ANY type of module.
  • Assign this module to the previously created Cobalt MenuItem (User's homepage).
  • Go to MenuItem in frontend: No module display :(

Sergey
Total posts: 13,748
16 Июнь 2015 04:54

Becuse Itemid will be always reset to the one you set in section parameters.


pepperstreet VIP
Total posts: 3,837
16 Июнь 2015 16:05

Sergey Becuse Itemid will be always reset to the one you set in section parameters.

:( Why is it "forced" for the User's homepage MenuItem, too. Since there is a seperate J! MenuItem, it should follow the Joomla logic. Does it makes sense to implement a 2. MenuItem parameter for User's homepage? How to solve that issue/shortcoming...


Sergey
Total posts: 13,748
17 Июнь 2015 06:24

pepperstreet Does it makes sense to implement a 2. MenuItem parameter for User's homepage?

Yes. That is exactly what have to be done here, to solve this issue.


pepperstreet VIP
Total posts: 3,837
30 Янв 2017 23:39

Sergey Cobalt 9

A gentle reminder for "extra ItemID for User's Homepage", or "Template for User's Homepage/Profile". ;)


Sergey
Total posts: 13,748
02 Фев 2017 13:02

So it should be a parameter in Cobalt global settings?


pepperstreet VIP
Total posts: 3,837
02 Фев 2017 20:10

Sergey So it should be a parameter in Cobalt global settings?

Maybe more versatile to have a Section parameter in Templates or better Personalisation tab? Comparable to the existing "default template" parameter.

Regarding the ItemID. Is it possible to "fetch" and keep the ItemID from the "homepage" menuItem? If not, there is also an existing Section parameter for TargetID. Does it make sense to add a second parameter where I select the "homepage"?


Sergey
Total posts: 13,748
10 Фев 2017 09:48

pepperstreet Does it make sense to add a second parameter where I select the "homepage"?

This makes more sense than add parameter to Cobalt configuration.

Работает на Cobalt