Keyword

Menu Item Link to K2 Users Blog

  • CuppaJoe
  • CuppaJoe's Avatar Topic Author
  • Offline
  • New Member
  • Share The Warmth
More
9 years 6 months ago #132741 by CuppaJoe
Menu Item Link to K2 Users Blog was created by CuppaJoe
Hello,
I wondered if someone could assist me.

I have the K2 User Module set up, this provides a link to a list view of that logged in users K2 items, published and unpublished.

What I would like to do is have the K2 User Module, redirect the user on login to that page.
Looking at the code for the module, that link uses :
<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>">

Now to be able to do this, I have to create a menu link, so that the menu link url can be specified in the Login Redirection URL in the module, but I can't find a way to do this.
I have tried using an External Menu Link, but it gets rejected, no doubt for the use of php.
We have No Number components and modules anywhere, so we could inject that way, some how but I dont know what code to use to do this.

The idea being, the user logins and is redirected to a page listing their K2 items and then we can add associated modules to that menu link later on.

Is this possible?
Could someone offer advise please?

Many thanks in advance.

Regards,

Joe,

ShareTheWarmth

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

  • CuppaJoe
  • CuppaJoe's Avatar Topic Author
  • Offline
  • New Member
  • Share The Warmth
More
9 years 6 months ago #132742 by CuppaJoe
Replied by CuppaJoe on topic Re: Menu Item Link to K2 Users Blog
Just a follow up.

With Joomla SEF and Rewrite OFF, typically the URL for the logged in users item list is:
index.php?option=com_k2&view=itemlist&task=user&id=XX:YY

If you create individual menu links to K2 User Blogs, so that they have their own menu ID, then the format is:
index.php?option=com_k2&view=itemlist&task=user&id=XX:YY&Itemid=ZZ

Where XX=User ID, YY = User Name and ZZ = menu ID.

If you switch ON SEF and Rewrite, these URLs become:
component/k2/author/XX-YY or if you create the menu links to every users blog (too time consuming) then it would be a bit more meaningful.

So, Ideally, a menu link needs to be created that is essentially pointing to com_k2, view = itemlist get the userid and username (ideally, we dont want the userid in the url)

Still digging.

Regards,

Joe,

ShareTheWarmth

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #132743 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Menu Item Link to K2 Users Blog
To get rid of the id you indeed need a menu link.
If you want to simply clean up your URLS you can use this method:

Create a menu link to K2 categories and don't select any category. This way, all unresolved links will be assigned to this menu, preventing duplicates.

This will affect orphan tags as well.

Alternatively you can use an extension like sh404sef

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • CuppaJoe
  • CuppaJoe's Avatar Topic Author
  • Offline
  • New Member
  • Share The Warmth
More
9 years 6 months ago #132744 by CuppaJoe
Replied by CuppaJoe on topic Re: Menu Item Link to K2 Users Blog
Hello Krikor,

The problem still is, there is no K2 menu link available to point to the logged in users items.
The K2 menu link for User Blog requires that a user is selected, which will not work as it will be a static link, which should need to check the logged in user and display their items.

Maybe this could be a feature request.
Imagine, you have the K2 User Profile page menu link, checks the logged in user to show their profile.
New K2 Menu Link to check the logged in user and show only their items, both published and unpublished.

Regards,

Joe,

ShareTheWarmth

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #132745 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Menu Item Link to K2 Users Blog
Ok I see the picture now.

You need to use a K2 User module. This module has the links you need.
If you do not need it to be shown for guest user, you change the module's access level.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • CuppaJoe
  • CuppaJoe's Avatar Topic Author
  • Offline
  • New Member
  • Share The Warmth
More
9 years 6 months ago #132746 by CuppaJoe
Replied by CuppaJoe on topic Re: Menu Item Link to K2 Users Blog
Hi Krikor,

Almost there.

The idea is, user logs in and is directed to a page containing their just their (author) itemlist view.

To do this a menu needs to be created to load the view.
This menu link is then specified in the K2 User module and so that the K2 User module can be assigned to the menu item.

Essentially this is a com_k2 view=author id=XX where XX is the logged in ID or change id for username=

However, as no K2 menu exists, we cant create the view to be able to do this.

This would mean having to not redirect or redirect to a page that doesn't display the view that is required, that has a K2 User module on it and somehow force the user to click the link to their view, not very user friendly.

Regards,

Joe,

ShareTheWarmth

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #132747 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Menu Item Link to K2 Users Blog
The K2 user module can be docked (fixed position) on the top so the redirection is not needed and the user can access his page from the entire site.

A personal note here. I prefer JS componentes like this: foundation.zurb.com/docs/v/3.2.5/joyride.php | zurb.com/playground/jquery-joyride-feature-tour-plugin (with cookies obviously) rather than being redirected every time I log in.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum